chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
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.
asked by dzungtran (600 points)

1 Answer

0 votes
We didn't manage to reproduce the issue.

In order to analyze the issue I need more details.
Which .NET and Visual Studio versions are you using?
I'd also like to know which Runner are you using?
answered by Bar (3.3k points)
...