Chapter 11Using Test Doubles

About This Chapter

The last few chapters concluding with Chapter 10, Result Verification, introduced the basic mechanisms of running tests using the xUnit family of Test Automation Frameworks (page 298). For the most part we assumed that the SUT was designed such that it could be tested easily in isolation of other pieces of software. When a class does not depend on any other classes, testing it is relatively straightforward and the techniques described in this chapter are unnecessary. When a class does depend on other classes, we have two choices: We can test it together with all the other classes it depends on or we can try to isolate it from the other classes so that we can test it by itself. This chapter introduces ...

Get xUnit Test Patterns: Refactoring Test Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.