Specify that an intercepted call will try to execute the real logic of the intercepted instance.
Namespace: TypeMock.ArrangeActAssert.Fluent
Assembly: Typemock.ArrangeActAssert (in Typemock.ArrangeActAssert.dll) Version: 9.4.1.0 (9.4.1.0)
Syntax
Remarks
Before using this directive make sure that the intercepted method has a real implementation that can be executed.
Examples
[TestMethod] [Isolated] public void CallOriginalOnFakeInstance() { RealLogger fake = Isolate.Fake.Instance<RealLogger>(Members.ReturnNulls); // Override the Increment() method to call its original implementation Isolate.WhenCalled(() => fake.Increment()).CallOriginal(); // Make sure Count is reset fake.Count = 0; // This call now redirects to its original implementation - the count should increment fake.Increment(); Assert.AreEqual(1, fake.Count); // even though we called the original implementation, we can still verify the call happened Isolate.Verify.WasCalledWithAnyArguments(() => fake.Increment()); }
See Also