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 so any class which needs to interact with another will be passed an interface, which the depended on class subscribes to, in the constructor. So in the tests, we can just pass in a mock implementation of this interface instead.

Setting up and using mocks

We are using Mock

Clone this wiki locally