public void ShouldBeAbleToSynchronouslyWaitForVoidAsyncResult() { // Arrange var host = new AsyncSource(GetRandomInt()); Expect(host.DoStuffCalls).To.Equal(0); // Act host.DoStuffAsync().WaitSync(); // Assert Expect(host.DoStuffCalls).To.Equal(1); }
public void ShouldBeAbleToSynchronouslyRetrieveAsyncResult() { // Arrange var expected = GetRandomInt(); var host = new AsyncSource(expected); // Pre-assert // Act var result = host.GetValueAsync().GetResultSync(); // Assert Expect(result).To.Equal(expected); }