Beispiel #1
0
 public async Task Success()
 {
     var handler =
         new ThrowFulcrumExceptionOnFailForTest {
         UnitTest_SendAsyncDependencyInjection = SendAsyncSuccess
     };
     var request = new HttpRequestMessage(HttpMethod.Post, "http://example.com/exception");
     await handler.SendAsync(request);
 }
Beispiel #2
0
        public async Task RequestPostponedException()
        {
            var handler =
                new ThrowFulcrumExceptionOnFailForTest {
                UnitTest_SendAsyncDependencyInjection = SendAsyncRequestPostponedException
            };
            var request = new HttpRequestMessage(HttpMethod.Post, "http://example.com/exception");

            try
            {
                await handler.SendAsync(request);

                Assert.Fail("Expected an exception");
            }
            catch (Exception e)
            {
                Assert.IsNotNull(e as RequestPostponedException, $"Expected exception of type {nameof(RequestPostponedException)}, but was {e.GetType().FullName}");
            }
        }