I know this question is part of a bit of a religious war, but I have the following situation:
I have an object, Responder
that calls a method on object Updater
in response to different events. I recently separated the testing in this way: state-based tests for the Updater
method itself, and behavior-based tests for the Responder
that calls it. That is, I mock the Updater
in the Responder
tests, just to ensure that it is called.
Should I still be testing the state of the objects that are supposed to be updated in the Responder
tests and not mocking the Updater
? I like what I have done because it requires less setup and seems to better isolate the tests. However, this seems to tie the implementation and expected behavior of Responder
to Updater
. Is that too brittle? This is a simplified example.