Interactions
Learn about the test double by analyzing various code segments that perform such tests.
We'll cover the following...
Now, what about those side effects? It’s a huge pain to augment our code with constructs like “If in test mode, don’t actually connect to the database." Instead, most languages have a mechanism for creating test doubles that take the place of the resource our function wants to use.
Test double
In test double, the code undergoing the test is isolated from the rest of the code, and all facets of its behavior are ...