4 ms·
The idea is that if you end up with code like this, it shows you have too many collaborators and should refactor them away.
by glenjamin 12y ago
The idea is that if you end up with code like this, it shows you have too many collaborators and should refactor them away.
- oelmekki 12y agoExactly. An other reason could be it's a main entry point for code execution, a class that only purpose is the glue others. In that case, having a lot of mocks is a code smell pointing that you should probably test this on the integration level rather than on the unit one (and thus, discard mocks and use "real" everything). (but beware not to be too much self indulgent on what is a gluing class, most of the time, they are not and it's indeed a god class problem).