コード例 #1
0
        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);
        }
コード例 #2
0
 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);
 }
コード例 #3
0
 public async Task TestSuccessSecondTry()
 {
     var fooService = new FooService();
     await AssertEx.WaitUntil(() => fooService.GetFooAsync())
     .IsTrue(f => f.Bar == "bar" && f.TryCount == 2);
 }