In a VB test project in Visual Studio 2013 Update 5 on Windows 10, previously passing tests coded using the TypeMock VB syntax ("Using TheseCalls.WillReturn(1)...") throw a TypeLoadException with the following message:
System.TypeLoadException: Could not load type 'TypeMock.ArrangeActAssert.AAAScopes.VBRecordScope' from assembly 'TypeMock, Version=8.1.4.0, Culture=neutral, PublicKeyToken=3dae460033b8d8e2
I have tested this in several configurations and have a minimal test solution that demonstrates the issue if you want it. I have tried 3 different cases in three separate test projects, all inside a VB solution:
CASE 1 - VB all the way
The test project is VB and has references to TypeMock and Typemock.Isolator.VisualBasic. The test is coded in VB TypeMock syntax. The test fails with the TypeLoadException noted above. It is not discovered or run by TypeMock Test Navigator.
(Note: Adding a reference to Typemock.ArrangeActAssert this test project does not help.)
CASE 2 - VB and C# hybrid
The test project is VB and has references to TypeMock and Typemock.ArrangeActAssert. The test is coded in C# TypeMock syntax ("Isolate.WhenCalled(Function() TypeMockTesting.TestClass.ReturnTwo()).WillReturn(1)"). The test passes but is not discovered or run by the TypeMock Test Navigator.
CASE 3 - C# all the way
The test project is C# and has references to TypeMock and Typemock.ArrangeActAssert. The test is coded in C# TypeMock syntax. The test passes and is also discovered and run by the TypeMock Test Navigator.
SYNTAX INFO:
VB syntax used in VB test project:
Using TheseCalls.WillReturn(1)
TypeMockTesting.TestClass.ReturnTwo()
End Using
C# syntax used in both VB-hybrid and C# test projects:
Isolate.WhenCalled(Function() TypeMockTesting.TestClass.ReturnTwo()).WillReturn(1)
STACK INFO:
The MS Test Explorer gives some stack info when the test fails. For what it's worth, here it is:
Result StackTrace:
at Typemock.Isolator.VisualBasic.CallsToLambdaConverter..ctor()
at Typemock.Isolator.VisualBasic.CallsToLambdaConverter..ctor(Boolean useExactArguments)
at Typemock.Isolator.VisualBasic.ReturnValueRecorder..ctor(Object value, Boolean exactArguments)
at Typemock.Isolator.VisualBasic.TheseCallsInstance.WillReturn(Object value)
at Typemock.Isolator.VisualBasic.TheseCalls.WillReturn(Object value)
at UnitTestProjectVB.UnitTestVB.TestMethodUsingVBSyntax() in C:UsersDaviddocumentsisual studio 2013ProjectsTypeMockTestingUnitTestProjectVBUnitTestVB.vb:line 11