예제 #1
0
            public async Task AddsAcceptEncodingGzipToRequest()
            {
                // Arrange
                mockHandler.When("*").Respond(HttpStatusCode.OK);

                // Act
                var response = await handler.PublicSendAsync(new HttpRequestMessage(HttpMethod.Get, "http://localhost/"));

                // Assert
                var request = response.RequestMessage;

                Assert.Contains(new StringWithQualityHeaderValue("gzip"), request.Headers.AcceptEncoding.ToList());
            }
예제 #2
0
            public async Task ReturnsResponse()
            {
                // Arrange
                mockHandler.When("*").Respond(new StringContent("0123456789"));
                var request = new HttpRequestMessage();

                // Act
                var response = await handler.PublicSendAsync(request);

                // Assert
                Assert.IsAssignableFrom <HttpResponseMessage>(response);
            }