Exemple #1
0
        public async Task Should_complete_within_finishes_throws_exception()
        {
            // arrange
            var asyncAssertions = new AsyncActionAssertions(ThrowException);

            // act + assert
            await asyncAssertions.InvokingAsync(a => a.ShouldCompleteWithin(200.Milliseconds()))
            .ShouldThrow <ArgumentException>();
        }
Exemple #2
0
        public async Task Should_complete_within_doesntfinish()
        {
            // arrange
            var asyncAssertions = new AsyncActionAssertions(() => Tester(false));

            // act + assert
            await asyncAssertions.InvokingAsync(a => a.ShouldCompleteWithin(50.Milliseconds()))
            .ShouldThrow <AssertionException>();
        }