When I use Members.ReturnRecursiveFakes, it seems that all the mock object's method call can't be detected by WasCalledWithAnyArguments that takes in parameter.
Here's the production code
public class AnObject
{
public void DoNothing(AnObject anObj)
{
}
}
public class AnWrapperObject
{
public AnObject objAn
{
get;
private set;
}
public void CallDoNothing()
{
objAn.DoNothing(objAn);
}
}
Here's the test code
public void Test1()
{
AnWrapperObject wrappObj = Isolate.Fake.Instance<AnWrapperObject>(Members.ReturnRecursiveFakes);
Isolate.WhenCalled(() => wrappObj.CallDoNothing()).CallOriginal();
wrappObj.CallDoNothing();
Isolate.Verify.WasCalledWithAnyArguments(() => wrappObj.objAn.DoNothing(wrappObj.objAn));
}
And here's the exception trace:
failed:
TypeMock Verification: Method objAn.objAn.DoNothing() was expected but was not called
TypeMock.VerifyException:
TypeMock Verification: Method objAn.objAn.DoNothing() was expected but was not called
at bz.b(dk A_0, i A_1)
at bz.a(Action A_0)
If the method is AnObject.DoNothing() ( note that there is no method parameter), then the test can pass without problem.
________
Dodge Journey history