Mocking HttpClient in unit tests
HttpClient’s extensibility lies in the HttpMessageHandler passed to the constructor. Its intent is to allow platform specific implementations, but you can also mock it. There’s no need to create a decorator wrapper for HttpClient. If you’d prefer a DSL to using Moq, I have a library up on GitHub/Nuget that makes things a little easier: … Read more