Example #1
0
        public async Task InvokeAsync_TimesOutAndFallbackThrows_RethrowsFallbackException()
        {
            var expected = new ExpectedTestException("Expected rethrown exception");
            var command = new TimingOutWithEchoThrowingFallbackCommand(expected);

            var e = await Assert.ThrowsAsync<ExpectedTestException>(() => command.InvokeAsync());
            Assert.Equal(expected, e);
        }
        public async Task InvokeAsync_TimesOutAndFallbackThrows_RethrowsFallbackException()
        {
            var expected = new ExpectedTestException("Expected rethrown exception");
            var command = new TimingOutWithEchoThrowingFallbackCommand(expected);
            try
            {
                await command.InvokeAsync();
            }
            catch (ExpectedTestException e)
            {
                Assert.Equal(expected, e);
                return; // Expected.
            }

            AssertX.FailExpectedException();
        }
Example #3
0
        public async Task InvokeAsync_TimesOutAndFallbackThrows_RethrowsFallbackException()
        {
            var expected = new ExpectedTestException("Expected rethrown exception");
            var command  = new TimingOutWithEchoThrowingFallbackCommand(expected);

            try
            {
                await command.InvokeAsync();
            }
            catch (ExpectedTestException e)
            {
                Assert.Equal(expected, e);
                return; // Expected.
            }

            AssertX.FailExpectedException();
        }