4 ms·
> If your whole test is "This gets called, then that, then that", you aren't actually writing a test. You're repeating what the code already says. Yeah, mocks
by Seenso 7y ago
> If your whole test is "This gets called, then that, then that", you aren't actually writing a test. You're repeating what the code already says.
Yeah, mocks are just a way to zero out the dependencies so you can focus on the unit you're actually trying to unit test. If all you're doing is zeroing out dependencies, you're not testing much. Every mock you bring in carries and assumption, and those assumptions need to be tested, too.
Cases like that really call for some small scale integration unit tests, where you actually bring in your dependencies and test them all working together.