3 ms·
I mostly agree, but with one exception - I think mocks are still useful for RPCs to other systems, where you want to test that you: 1) Call the right method on
by marklar423 3y ago
I mostly agree, but with one exception - I think mocks are still useful for RPCs to other systems, where you want to test that you:
1) Call the right method on the interface with the right data, and
2) Correctly handle different return values from the RPC.
If you change your code to call a different RPC method your test _should_ fail, I'd argue that's exactly the point of this sort of test.
On the other hand, for testing code that you entirely control, I 100% agree that a fake would provide a better test,