One of the hallmark of a good unit test is its maintainability. The test that is not maintainable is a pain and there is a higher tendency for it to be ignored. One of the mistakes in software testing is Over-specification of tests. This problem often comes with testing object interaction with a mock object when …
Mock
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 …