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?