In this book, you created all the needed mocks yourself. You may have noticed that this is a boring task. Most mock classes consisted of mainly boilerplate code. Fortunately, there is a solution: Sourcery (https://github.com/krzysztofzablocki/Sourcery). From its GitHub page:
"Sourcery scans your source code, applies your personal templates, and generates Swift code for you, allowing you to use meta-programming techniques to save time and decrease potential mistakes."
There are many templates for common tasks that are ready to use. For example, there is a template to generate mock classes from protocols. Let's have a look how we could use Sourcery to generate a mock for ItemCell.
To enable Sourcery to generate the code, we need to add a protocol with the methods that should be mocked. Imagine, we want to generate a mock for the method...