¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: [TDD] Single assert / Single mock rule in practice


Mateusz ?oskot
 

On 16 January 2014 10:33, Roy Osherove <roy@...> wrote:
For example, I would use a STUB for a get_something if not faking it meant an integration test.?
I would not use a mock for it, since it is giving info back into the application.
I would use a mock only if there an is a "tell" operation on a collaborator as an end result.?
stubs: queries
mocks: commands
but only when you have no other choice but to fake it. I would rather test state or a return value and have only real classes. Mocks make tests complicated.

Roy,

Thanks for the excellent clarification, it helps to grasp other resources of yours that I've had pleasure to read/watch.

Best regards,
--
Mateusz ??oskot,

Join [email protected] to automatically receive all group messages.