Example #1
0
            public async Task CallsSendAsyncOnInnerHandler()
            {
                // Arrange
                var innerHandler           = new MockHttpMessageHandler();
                var handler                = new HttpMessageHandlerAdapter(innerHandler);
                HttpRequestMessage request = new HttpRequestMessage();

                // Act
                await handler.PublicSendAsync(request);

                // Assert
                Assert.True(innerHandler.SendAsyncCalled);
            }
Example #2
0
            public async Task RequestIsNull_ThrowsArgumentNullException()
            {
                // Arrange
                var innerHandler           = new MockHttpMessageHandler();
                var handler                = new HttpMessageHandlerAdapter(innerHandler);
                HttpRequestMessage request = null;

                // Act -> Assert
                await Assert.ThrowsAsync <ArgumentNullException>(() =>
                {
                    return(handler.PublicSendAsync(request));
                });
            }