Hi
is there a way I can fake an instance, and "add" functionality to a specific method?
For example, in the following I'd like to swap instances of "MyClass" with a fake, but actually only replace the method "MyMethod" with a fake method which actually performs a bit of extra checking for my test, and then calls on to the real instance method to complete processing.
MyClass mc = Isolate.Fake.Instance<MyClass>(Members.CallOriginal);
Isolate.WhenCalled(() => mc.MyMethod(null)).
DoInstead((callContext) =>
{
// do some special test/check stuff....
// call real instance MyMethod and return its value...
});
Isolate.Swap.AllInstances<MyClass>().With(mc);
Thanks, Peter