Allow recursive calls to this faked method to be faked and reenter DoInstead lambda
Namespace: TypeMock
Assembly: TypeMock (in TypeMock.dll) Version: 9.3.6.0 (9.3.6.0)
Syntax
Property Value
Type: BooleanRemarks
Examples
public int Foo(int i) { if (i==0) return 1; return Foo(i)+1; } [Isolated,TestMethod] public void Test() { bool called=false; Isolate.WhenCalled(() => Foo(0)).DoInstead(context=> { // allow calls down the stack to be faked context.ContinueFakingThisMethodRecursively = true; // call original code with different arg int passedVal = (int)context.Parameters[0]; return context.Method.Invoke(context.Instance, new object[] { passedVal + 1}); }); Assert.AreEqual(foo(), 1); }
See Also