#29 cannot create new Mocks after a failed CreateType

open
nobody
None
5
2008-05-06
2008-05-06
No

When trying to create a Mock with generic methods, the MockObjectFactory.CreateType() Method throws an exception after having created the Type but before adding the Type to the createdTypes Hashtable. This causes the next call to GetMockedType() to try to create a Type with the same name. This is not allowed, therefore all further CreateType calls fail.

I've attached a simple patch to workaround this problem.

Discussion

  • Thomas Weingartner

    Logged In: YES
    user_id=1140914
    Originator: NO

    This should be fixed in NMock2 (see http://nmock2.sourceforge.net\).

    Have fun
    Thomas

     

Log in to post a comment.