Using v6.03
I am attempting to fake an instance of a Windows form like this:
var fakeForm = Isolate.Fake.Instance<Form>(Members.ReturnRecursiveFakes, ConstructorWillBe.Ignored, BaseConstructorWillBe.Ignored);
when I run the test, Isolator complains:
DataLibTests.ConnectionManagerTests.ParseConnectionStringStyleSettings:
TypeMock.TypeMockException :
*** Typemock cannot evaluate new instance constructors of mocked type.
The stack trace looks like this which clearly shows the Forms..ctor() is being called.
at e1.a()
at h1.a(String A_0, Mock A_1, gy A_2, Int32& A_3)
at h1.a(String A_0, Object A_1, Object A_2, Type& A_3, String A_4)
at System.Windows.Forms.Form..ctor()
at if.CreateFakeInstance[T](Members behavior, Constructor constructorFlag, Constructor baseConstructorFlag, Type baseType, Object[] ctorArgs)
at if.Instance[T](Members behavior, ConstructorWillBe constructorBehavior, BaseConstructorWillBe baseConstructorBehavior)
at DataLibTests.ConnectionManagerTests.ParseConnectionStringStyleSettings() in c:dev7SourceTestsDataLibTestsConnectionManagerTests.cs:line 41
at TypeMock.MockManager.a(String A_0, String A_1, Object A_2, Object A_3, Boolean A_4, Object[] A_5)
at TypeMock.InternalMockManager.getReturn(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected)
at DataLibTests.ConnectionManagerTests.ParseConnectionStringStyleSettings() in c:dev7SourceTestsDataLibTestsConnectionManagerTests.cs:line 38