Multiple mocks, asserts, and hidden results
Posted by: ISerializable,
on 09 Feb 2011 |
View original | Bookmarked: 0 time(s)
In his post one mock per test considered harmful , Phillip suggests that having multiple mocks used could make a more readable specification. he also disagrees with the way I provide some of the advice in my book. First, Id like to get to the technical issue at the heart of this matter. Why do I not want to test more than one thing in the test? because mock verifications, much like asserts, throw exceptions. That means that any verifications below that line never get called and so youll never...