Understanding dependency
If your code does something useful, chances are your code depends on other code or another component, which in turn depends on another component. A clear understanding of the dependency terminology should give you a better grasp of unit testing and will definitely aid in having clearer conversations with your colleagues.
The plan in this section is to familiarize you with the concept of dependency, which should make understanding the DI pattern easier. Understanding dependency and DI are prerequisites for writing any serious unit testing. Next, we will explore what dependencies are, though when it comes to unit testing, we don’t care for all dependencies, so we will define what a relevant dependency is.
Before we dive into dependencies, let’s first define abstraction types and concrete types.
Abstractions and concrete types
To have you and me on the same channel, I will define the terminology to be used.
A concrete class is a class...