Recently in my company we wanted to use IHttpClientFactory with our web app. But the problem was IHttpClientFactory was originally meant to be used with Asp.Net Core and not MVC 5. So I had to find a workaround that to be able to use it with older MVC applications. So in this post I’m going …
HttpClient
Mock HttpClient Without Wrapper Using HttpMessageHandler
There is a lot of discussion on github about why HttpClient doesn’t have an interface. Despite the long winded discussion on github about the subject, I think mocking the HttpClient isn’t that hard. We can solve this problem with a wrapper, but wrappers are not a good idea when we can avoid them. Partly because …