I tried to use Isolate.Verify to verify the desired execution path across multiple async operations.
It seems that calls made on a thread different than the caller are not detected by Isolator.
Is this a known issue? Are there any workarounds or patches?
Below is a sample code that illustrates the problem (the test fails!):
[TestMethod]
public void Test1()
{
// Arrange
//
var fakeEventsKit = Isolate.Fake.Instance<IReportsRetrievalEventsKit>();
// Act
//
Action<IReportsRetrievalEventsKit> action = eventsKit => eventsKit.NotifyRetrieveReportCompletedSuccessfully();
action.EndInvoke(action.BeginInvoke(fakeEventsKit, null, null));
// Assert
//
Isolate.Verify.WasCalledWithAnyArguments(() => fakeEventsKit.NotifyRetrieveReportCompletedSuccessfully());
}
Thanks,
Noam