I'm are currently having an issue with TypeMock 6.0.2 when running tests using TypeMock.Isolator.VisualBasic.
I'm running Windows 7 64 bit with Visual Studio 2010.
VB.Net code is compiled in .Net Framework v4.0.30319. I ran the test with VS Testrunner and also tried it with TestDriven.Net 3.0 RC.
This problem occured after I upgraded from TypeMock v5.3.1.0 to v6.0.2.0.
To reproduce the problem I've created a test based on the code found here:
http://site.typemock.com/vbpage
Error message:
Test method TestProject3.UnitTest1.TestMethod_Isolator_Will_Fail threw exception:
System.MissingFieldException: Field not found: 'TypeMock.MockManager.q'.
Stack trace:
Typemock.Isolator.VisualBasic.IsolatedAttribute.Execute()
TypeMock.MockManager.a(String A_0, String A_1, Object A_2, Object A_3, Boolean A_4, Object[] A_5)
TypeMock.InternalMockManager.getReturn(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected)
TestProject3.UnitTest1.TestMethod_Isolator_Will_Fail() in D:ProjectsTestingTestProject3TestProject3UnitTest1.vb: line 16
Code sample:
Imports System.Text
Imports TypeMock.Isolator.VisualBasic
Imports Typemock
<TestClass()>
Public Class UnitTest1
Public Property TestContext() As TestContext
<TestMethod()> _
<Isolated()> _
Public Sub TestMethod_Isolator_Will_Fail()
Dim fakeProduct As Product = FakeInstance(Of Product)()
' Fake a return value
Using TheseCalls.WillReturn(100.0F)
fakeProduct.CalculatePrice(0)
Dim dummy As Single = fakeProduct.Price
End Using
Assert.AreEqual(fakeProduct.Price, 100.0F)
End Sub
End Class
Public Class Product
Public Sub CalculatePrice(ByVal value As Integer)
Price = value
End Sub
Public Property Price() As Single
End Class