Specify that the intercepted method will return the given value.
The real implementation will not be executed.
Namespace: TypeMock.ArrangeActAssert.Fluent
Assembly: Typemock.ArrangeActAssert (in Typemock.ArrangeActAssert.dll) Version: 9.4.1.0 (9.4.1.0)
Syntax
Parameters
- value
- Type: T
The fake value to return when the call is intercepted
Examples
[TestMethod] [Isolated] public void FakeAnInstance_ChangeMethodReturnValue() { RealLogger fake = Isolate.Fake.Instance<RealLogger>(); // Change the return value for Count property Isolate.WhenCalled(() => fake.Count).WillReturn(10); // fake.Count will return the assigned value Assert.AreEqual(10, fake.Count); }
See Also