Now, I would like to Isolate the c++ managed wrapper and run my test.
I mytest, I have the following lines, I want to mock the GetReaderInfo of ManagedWrapper
var fakeReader = Isolate.Fake.Instance<Reader>(Members.ReturnRecursiveFakes);
Isolate.WhenCalled(() => fakeReader.GetReaderInfo()).WillReturn(myreaderinfo);
----------------------------------------------------------------------------8<--------------------------------------------------------------------------------
Test Name: TestMethod
Test FullName: UnitTests.namespace1.TestClass.TestMethod
Test Source: j:ilepath : line xx
Test Outcome: Failed
Test Duration: 0:00:xx.xx
Result Message:
Test method namespace.TestMethod threw exception:
System.BadImageFormatException: Could not load file or assembly 'ManagedWrapper, Version=x.x.x.x, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
TestCleanup method Product.UnitTests.namespace1.TestClass.TestCleanup threw exception. System.TypeInitializationException: System.TypeInitializationException: The type initializer for 'namespace2.WrapperManager' threw an exception. ---> System.BadImageFormatException: Could not load file or assembly 'ManagedWrapper, Version=x.x.x.x, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format..
Result StackTrace:
at UnitTests.namespace1.TestClass.TestMethod()
TestCleanup Stack Trace
at TypeMock.MockManager.getReturn(Object context, String typeName, String methodName, Object methodGenericParams, Boolean isDecorated, Boolean isInterceptedType, Object[] methodArguments)
at Typemock.Interceptors.Profiler.InternalMockManager.getReturn(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected, Boolean isInterceptedType)
at UnitTests.namespace1.TestClass.TestCleanup() in j:ilepath.cs:line xx
---------------------------------------------------------------------------->8--------------------------------------------------------------------------------