IsolateFake Property

Typemock Isolator Developer Guide
A read-only property, used to fake a new object.

Namespace:  TypeMock.ArrangeActAssert
Assembly:  Typemock.ArrangeActAssert (in Typemock.ArrangeActAssert.dll) Version: 9.4.1.0 (9.4.1.0)
Syntax

public static IFaker Fake { get; }

Return Value

Type: IFaker
An IFaker interface reference.
Remarks

Because of the nature of fluent interface, you need to use Fake with its proceeding methods - see IFaker for details.
Examples

This example shows how to use Fake in order to fake a RealLogger instance:
[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

Reference