Skip to content

Writing Unit Tests

Emma Corbett edited this page Jun 26, 2020 · 13 revisions

Unit tests are used to test the functionality of a class in isolation. So if a class depends on another we will need to mock any interactions with that class. We are using dependency injection which makes it easy to do this. As we pass the interface of the depended on class into the constructor, in the tests we can pass in a mock implementation of this interface instead.

Setting up and using mocks

We are using Mock

Clone this wiki locally