On 15 January 2014 20:20, Adam Sroka <adam.sroka@...> wrote:
Are you familiar with Command Query Separation (CQS)?
Sort of, related to Tell, Don't Ask?
I'll learn about it, thanks.
I've always found that the most coherent and useful way to explain why you would choose a mock or a stub. The most interesting thing about a method is either what it returns or, in the case where you don't care what it returns, whether it was called with the correct semantics, not both.?
So, if the SUT cares about the value that a method returns then you stub that method, only. If the SUT doesn't care about the value a method returns then you use a mock and verify the call has the expected semantics, only.?
?
That is something!
That actually answers my original question on what approach to choose