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 create simple project to investigate issue with static method.
First class - wrapper class
public class Wrapper<T> where T: class
{
public static T Create(string name)
{
throw new NotImplementedException();
}
}
and stub
public partial class WcfStubClient
{
}

Test for first class is
[TestMethod]
public void MethodWasNotCalled()
{
Processor processor = new Processor();
Isolate.Fake.StaticMethods(typeof(Wrapper<WcfStubClient>));

processor.CanProcess(null);

Isolate.Verify.WasNotCalled(() => Wrapper<WcfStubClient>.Create(null));
}
Test result is "*** Cannot use Isolate.Verify on a static method without first setting static method behavior using Isolate.Fake.StaticMethods()"

What's wrong in my test? What's missing?
asked by Stialy (600 points)

1 Answer

0 votes
Hi Stialy,

We've recently fixed a similar bug.
This fix will be included in Isolator starting from the next release ( v7.0.9).

For now please install the patch, it should resolve the problem you have.
https://www.typemock.com/files/patches/T ... cPatch.msi

Please let us know if it helps.
answered by alex (17k points)
...