hi,
I'm having an issue with creation of Mock Object, and getting an ArgumentNullException error.
I'm having a Class called TestBase, which is having a function which takes a func<T> as a parameter.
public TR WebMethodCall<TR>(Func<TR> methodname);
so I create a Fake of it like this,
var testbase = Isolate.Fake.Instance<TestBase>();
Isolate.Swap.NextInstance<TestBase>().With(testbase );
Isolate.WhenCalled((Func<UserViewsResponseType_t> p) =>
testbase.WebMethodCall(p))
.AndArgumentsMatch(p => p != null && p == client.getUserViews)
.WillReturn(new UserViewsResponseType_t());
But I'm getting an error in the WhenCalled function, even though I have tried the same with other methods, and also for other classes they are working fine, so I think that there is a bug in the Typemock where we are trying to mock a function which takes funct<T> as a parameter.
Can you please help me out, as I'm stuck in a complex testing of our core module.
Thanks.