chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
Hi,

when I tell TypeMock not to mock the constructor of a type and create a new instance of that type I get the following strange Exception:

TestCase 'ValidationDBEditorPluginTest.Xxx.Validator.DatabaseEditor.VDBTreeViewTest.SetStateIcons_Test' failed: System.ArgumentException : Item has already been added.  Key in dictionary: "TypeMock.e"  Key being added: "TypeMock.e"
   at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
   at System.Collections.Hashtable.Add(Object key, Object value)
   at TypeMock.c.a(String A_0, Object A_1, Object A_2)
   at TypeMock.MockManager.a(String A_0, String A_1, Object A_2, Object A_3)
   at TypeMock.InternalMockManager.isMocked(Object that, String typeName, String methodName, Object methodParameters)
   e:scmwscoladacarddesigner_maindevelopmentssembliesalidationdbeditorpluginxxxalidatordatabaseeditor
odebase.cs(46,0): at Xxx.Validator.DatabaseEditor.NodeBase..ctor()
   at ValidationDBEditorPluginTest.Xxx.Validator.DatabaseEditor.Testnode..ctor()
   e:scmwscoladacarddesigner_main	estssembliesalidationdbeditorplugin
unitformstestxxxalidatordatabaseeditordbtreeviewtest.cs(228,0): at ValidationDBEditorPluginTest.Xxx.Validator.DatabaseEditor.VDBTreeViewTest.SetStateIcons_Test()


Does anybody know what I am doing wrong?
asked by mknaup (8.5k points)

3 Answers

0 votes
Hi Michael,

I will send you a patch offline. Please tell me if it fixes this problem.
answered by scott (32k points)
0 votes
Hi Scott,

Please tell me if it fixes this problem.


I'm very sorry but only the excpetion text changed when using the patch:

TestCase 'ValidationDBEditorPluginTest.Xxx.Validator.DatabaseEditor.VDBTreeViewTest.SetStateIcons_Test' failed: System.ArgumentException : Item has already been added.  Key in dictionary: "h"  Key being added: "h"
   at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
   at System.Collections.Hashtable.Add(Object key, Object value)
   at e.a(String A_0, Object A_1, Object A_2)
   at TypeMock.MockManager.a(String A_0, String A_1, Object A_2, Object A_3)
   at TypeMock.InternalMockManager.isMocked(Object that, String typeName, String methodName, Object methodParameters)
answered by mknaup (8.5k points)
0 votes
Hi Scott,

TypeMockSetup301.zip fixed the problem.

Thanks for your immediate and intensive help. :lol:
answered by mknaup (8.5k points)
...