Blog.Common.Utils.Tests.Helpers.HttpClientHelperTest.ShouldThrowExceptionWhenHttpClientFromGetResponseIsNull C# (CSharp) Method

ShouldThrowExceptionWhenHttpClientFromGetResponseIsNull() private method

        public void ShouldThrowExceptionWhenHttpClientFromGetResponseIsNull()
        {
            var fakeResponse = new HttpResponseMessage(HttpStatusCode.Accepted) { Content = null };
            var fakeHandler = new FakeHttpMessageHandler(fakeResponse);
            var httpClient = new HttpClient(fakeHandler) { BaseAddress = new Uri("http://localhost/") };

            var httpClientHelper = new HttpClientHelper { HttpClientObj = httpClient };
            Assert.Throws<BlogException>(() => httpClientHelper.Get("http://localhost/", "foo"));
        }