Exemplo n.º 1
0
        public async Task When_sending_response_should_reference_request()
        {
            var request = new HttpRequestMessage();

            // Act
            HttpResponseMessage response = await _sut.SendAsync(new MockHttpRequestContext(request), CancellationToken.None);

            // Assert
            response.RequestMessage.Should().Be(request);
        }
Exemplo n.º 2
0
 private Task <HttpResponseMessage> SendAsync(HttpCall setup, MockHttpRequestContext requestContext, CancellationToken cancellationToken)
 {
     ((InvokedHttpRequestCollection)InvokedRequests).Add(new InvokedHttpRequest(setup, requestContext.Request));
     return(setup.SendAsync(requestContext, cancellationToken));
 }