public void TestGetResponse(string method, bool isAsync)
        {
            using (ShimsContext.Create())
            {
                // Arrange
                var baseUriMapping = new BaseUriMapping {
                    { "TargetSite", "http://yahoo.com" }
                };
                var userAgentMapping = new UserAgentMapping {
                    { "IE11", "Mozilla IE11" }
                };

                var httpRequest = new HttpRequest
                {
                    BaseUri   = "TargetSite",
                    UserAgent = "IE11",
                    Method    = method,
                    Headers   = new NameValueCollection {
                        { "test", "test-value" }
                    },
                    PathInfos = new List <string> {
                        "test.aspx"
                    },
                    Cookies = new NameValueCollection {
                        { "test", "test-value" }
                    },
                };

                var httpContent = new StringContent("Hello World");
                httpContent.Headers.ContentType  = new MediaTypeHeaderValue("text/html");
                httpContent.Headers.LastModified = DateTimeOffset.Parse("Tue, 16 Jul 2013 11:50:35 GMT");

                var httpResponseMessage = new HttpResponseMessage
                {
                    StatusCode     = HttpStatusCode.OK,
                    Content        = httpContent,
                    RequestMessage = new HttpRequestMessage {
                        RequestUri = new Uri("http://yahoo.com/test.aspx")
                    }
                };

                httpResponseMessage.Headers.Add("test", "test-value");

                var cookies = new CookieContainer();
                cookies.Add(new Cookie("test", "test-value", "", "yahoo.com"));

                ShimHttpClientHandler.AllInstances.CookieContainerGet = h => cookies;
                ShimHttpClient.AllInstances.GetAsyncUri             = (client, task) => Task.FromResult(httpResponseMessage);
                ShimHttpClient.AllInstances.PostAsyncUriHttpContent = (client, task, c) => Task.FromResult(httpResponseMessage);
                ShimHttpClient.AllInstances.PutAsyncUriHttpContent  = (client, task, c) => Task.FromResult(httpResponseMessage);
                ShimHttpClient.AllInstances.DeleteAsyncUri          = (client, task) => Task.FromResult(httpResponseMessage);

                // Act
                var httpRequestService = new HttpRequestService(baseUriMapping, userAgentMapping, "http://proxy.com");
                var httpResponse       = isAsync
                    ? httpRequestService.GetResponseAsync(httpRequest).Result
                    : httpRequestService.GetResponse(httpRequest);

                // Assert
                Assert.AreEqual(1, httpResponse.Headers.Count);
                Assert.AreEqual(1, httpResponse.Cookies.Count);
                Assert.AreEqual(DateTimeOffset.Parse("Tue, 16 Jul 2013 11:50:35 GMT", CultureInfo.InvariantCulture), httpResponse.LastModified);
                Assert.AreEqual("Hello World", httpResponse.Contents);
                Assert.AreEqual(HttpStatusCode.OK, httpResponse.StatusCode);
                Assert.AreEqual(new Uri("http://yahoo.com/test.aspx"), httpResponse.Uri);
            }
        }