Identify responsibilities Does the class have a single responsibility? Yes test drive behaviour as normal No identify collaborating roles (interfaces) specify interactions using test doubles
queries; mock commands Doubles can return value objects or other doubles (but not objects with behaviour) Don’t stub or mock value objects or primitives
queries; mock commands Doubles can return value objects or other doubles (but not objects with behaviour) Don’t stub or mock value objects or primitives Don’t stub or mock the object under test
queries; mock commands Doubles can return value objects or other doubles (but not objects with behaviour) Don’t stub or mock value objects or primitives Don’t stub or mock the object under test
queries; mock commands Doubles can return value objects or other doubles (but not objects with behaviour) Don’t stub or mock value objects or primitives Don’t stub or mock the object under test *more what you’d call ‘guidelines’ than actual rules
transfer method that takes an amount and two Account objects (source and destination). When transfer is called, the source account should receive debit(amount) and the destination account credit(amount).