We’ve seen how using interfaces in place of concrete classes can make our code more flexible. In the unit tests we’ve written in previous parts of this series, this layer of abstraction allowed us to replace our modules’ dependencies with testing mocks. These mocks were created and set up with specific behaviours that allowed us to isolate and precisely target parts of a system to test.
Share this post
How to Unit Test and Mock Services with Date…
Share this post
We’ve seen how using interfaces in place of concrete classes can make our code more flexible. In the unit tests we’ve written in previous parts of this series, this layer of abstraction allowed us to replace our modules’ dependencies with testing mocks. These mocks were created and set up with specific behaviours that allowed us to isolate and precisely target parts of a system to test.