Chapter 13. Mocking Frameworks
Today the number of cases in which we want to implement test doubles by hand is quite limited. Mocking frameworks have been evolving for several years and have reached full maturity by now. At the time of writing, they’ve gone through generations of evolution and have reached a point where they offer very rich functionality and truly simplify many aspects of interaction testing. A case in point is the fact that mocking frameworks, despite their names, not only construct mock objects, but also stubs and spies.1 My experience is that this versatility often leads to confusing tests, where the role of the test double is ambiguous and unclear. That’s why I emphasize the type of test double wherever possible. To avoid ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access