IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method IgnoreCall Method
Specify that an intercepted call should be ignored without executing any logic.

Namespace:  TypeMock.ArrangeActAssert.Fluent
Assembly:  Typemock.ArrangeActAssert (in Typemock.ArrangeActAssert.dll) Version: 8.6.2.0 (8.6.2.0)

Syntax

C#
void IgnoreCall()
Visual Basic (Declaration)
Sub IgnoreCall
Visual C++
void IgnoreCall()

Remarks

This interface is returned by WhenCalled(Action) method.

Examples

This example shows using IgnoreCall() to stub out a call to a method:
CopyC#
[TestMethod]
[Isolated]
public void FakeAnInstance_StubIncrementMethod()
{
    RealLogger fake = Isolate.Fake.Instance<RealLogger>();

    // Increment call will be ignored (stubbed)
    Isolate.WhenCalled(() => fake.Increment()).IgnoreCall();

    // Make sure Count is reset
    fake.Count = 0;

    // This call is faked - count should not increment
    fake.Increment();

    Assert.AreEqual(0, fake.Count);
}

See Also