richardszalay/mockhttp

Documentation out of date

jfreyre opened this issue · 1 comments

Hey!

I just tried to use your package and by reading the doc we're supposed to do

var httpClient = mockHttp.ToHttpClient();

but... I had the error that ToHttpClient do not exist.

Then I checkout your repo and seen in the test that you're doing

 [Fact]
        public void Should_respond_with_basic_requests()
        {
            var mockHandler = new MockHttpMessageHandler();

            mockHandler
                .When("/test")
                .Respond("application/json", "{'status' : 'OK'}");

            var result = new HttpClient(mockHandler).GetAsync("http://invalid/test").Result;

            Assert.Equal(System.Net.HttpStatusCode.OK, result.StatusCode);
            Assert.Equal("application/json", result.Content.Headers.ContentType.MediaType);
            Assert.Equal("{'status' : 'OK'}", result.Content.ReadAsStringAsync().Result);
        }

Am I right ? Or did I miss something ?

My bad... Visual studio automatically a very old version of the package...