3 ms·
A simple example might be a function that makes an HTTP request to a server. You could separate out a function that builds the request from a function that send
by assbuttbuttass 4y ago
A simple example might be a function that makes an HTTP request to a server. You could separate out a function that builds the request from a function that sends the request to the server. Then it's easy to unit test that the request is what you expect, without coding up a realistic fake for the server.