I have this simple code below:
[TestMethod]
public void ExampleTest()
{
Isolate.WhenCalled(() => DateTime.Now).WillReturn(new DateTime(2016, 2, 29, 2, 0, 0));
var x = DateTime.Now;
}
Executing this will throw a TypeMockException of "
*** No method calls found in recording block. Please check:
* Are you trying to fake a field instead of a property?
* Are you are trying to fake an unsupported mscorlib type? See supported types here:
https://www.typemock.com/mscorlib-types"
Stacktrace (the last line modified to point out which line in my code threw the exception):
at gg.a(cx A_0, Boolean A_1)
at bh.a(Boolean A_0)
at dl.b(Boolean A_0)
at ij.b(Boolean A_0)
at ij.a(Object A_0, Boolean A_1, Func`1 A_2, Action A_3, Action A_4, Action A_5, Boolean A_6)
at ij.e(Object A_0)
at TypeMock.ArrangeActAssert.ExpectationEngine`1.a(TResult A_0)
at Isolate.WhenCalled(() => DateTime.Now).WillReturn(new DateTime(2016, 2, 29, 2, 0, 0));
I have TypeMock Isolator version 7.3.0.0. I've verified that the Typemock.Interceptors.dll version 7.3.0.0 is in the GAC. Thank you.