029: Mock – Test Doubles

This episode of Testing All The Things we continue a series where we look at different forms of Test Doubles. We will look at a different type of Test Double in each of the videos. We will implement our own test doubles, we will not use a mocking framework.

We use Test Doubles to replace the dependencies a class uses in production so we have complete control over its dependencies enabling us to isolate the code under test from the implementation of its dependencies.

In the video we look at the Mock type of Test Double.

The code produced during the Test Doubles episodes can be found on GitHub

Episode 004 – Mock Test Doubles

In Episode 4 of Testing All The Things we continue to create the driving licence generator we started in the previous two videos. In this video we create a mock random number generator to create random digits to the end of the driving licence number.

You can find all the Test Double code in this GitHub repository or just the code created for the spy functionality in this commit