Debugger Enhancements
Using either the watch window or tooltip to evaluate the function return value is very helpful during debugging. Typemock Isolator enhances these tools.
When evaluating a property, Typemock Isolator does not sequence the results. For example, there is the following code:
C# [Isolated] [TestMethod] public void WhenCalledWillReturnOnProperties_TwoCallsToWhenCalled_TheFirstCallRepeatOnceTheSecondIsDefault() { var fakeLogger = Isolate.Fake.Instance<RealLogger>(); Isolate.WhenCalled(() => fakeLogger.Prop).WillReturn(10); Isolate.WhenCalled(() => fakeLogger.Prop).WillReturn(100); Assert.AreEqual(10, fakeLogger.Prop); Assert.AreEqual(100, fakeLogger.Prop); Assert.AreEqual(100, fakeLogger.Prop); }
When you check the property within the debugger, the sequencing is frozen, regardless of whether you evaluate it from the Local, Watch, Immediate, or Quick Watch windows.
In the following sample, there is an expectation set on Prop. When you set a breakpoint before the first assertion which expects the mocked return value, both the Watch window and tooltip show the expected mock value 10.
The following figure shows the next assertion. In this case, 100 should be returned. The Watch window and tooltip show this value.