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
Condition testing:

Isolate.Verify.WasNotCalled(() => StaticClass.Fetch<TypeA>(null));


Code under test actually will call:
StaticClass.Fetch<TypeB>(new object());


But because Isolator apparently isn't considering the generic type in it's assertion you will get a Isolation verification exception stating that:

TypeMock Verification: Method StaticClass.Fetch<T>(System.Object)) was called unexpectedly.

HOWEVER:

If instead your test was:

Isolate.Verify.WasNotCalled(() => StaticClass.Fetch<TypeA>());


And the code being ran was:
StaticClass.Fetch<TypeB>();


You would not, as expected, get an expection.

---

So it seems like when we introduce a parameter, the generic classifier is being ignored, whereas, if there are no parameters, the generic classified is considered in the WasNotCalled verification.
asked by boo (21.8k points)

1 Answer

0 votes
Hi Brian

I checked it out and actually I'm getting the same exception in both tests.
We'll investigate this problem and update you as soon as we'll have something.

Thanks for reporting it.
answered by ohad (35.4k points)
...