public async Task TestWaitAll() { var fooService = new FooService(); await Task.WhenAll( AssertEx.WaitUntil(() => fooService.GetFooAsync()) .IsTrue(f => f.Bar == "bar"), AssertEx.WaitUntil(() => fooService.GetFooAsync()) .IsTrue(f => f.Bar == "bar")); AssertEx.IsTrue(() => fooService.TryCount == 2); }
public async Task TestFailThirdTrySmallTimeout() { var fooService = new FooService(); await AssertEx.WaitUntil(() => fooService.GetFooAsync()) .WithTimeout(TimeSpan.FromMilliseconds(1)) .IsTrue(f => f.Bar == "bar" && f.TryCount == 3); }
public async Task TestSuccessSecondTry() { var fooService = new FooService(); await AssertEx.WaitUntil(() => fooService.GetFooAsync()) .IsTrue(f => f.Bar == "bar" && f.TryCount == 2); }