4

Real Unit Testing with Test Doubles

A unit test differentiates itself from other test categories by using test doubles; actually, you would rarely see a unit test without a test double.

There is a lot of confusion on the web about what that means. My aim in this chapter is to clarify this term so that you can use it in the right context and give you as many explained examples of the topic so you feel confident in selecting the right test double for the test at hand.

In this chapter, we will:

  • Explain the concepts and usage of test doubles
  • Discuss more testing categories

By the end of the chapter, you will understand what is special about unit testing and will be able to use test doubles to start writing realistic unit tests.

Technical requirements ...

Get Pragmatic Test-Driven Development in C# and .NET 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.