3 ms·
> You mock the external service to unit test the internal logic You only need the output produced by that external service or the the input expected by that se
by u801e 5y ago
> You mock the external service to unit test the internal logic
You only need the output produced by that external service or the the input expected by that service. For example, I can pass in a data structure or object representing the HTTP request to the method that I'm unit testing, but I don't need to mock a client to generate those requests to test that logic.