You may have to reorganize it to introduce hooks for dependency injection. For example, a class containing the DoXYZ method can get new properties for ABC and XYZ. These properties can be used by default for ABC and XYZ instances, but in unit tests they can be replaced with mock versions.
And if you prefer to use IoC, this approach also supports this.
source
share