Unit Test the Untestable

Introduction In this article I will go through some untestable classes and make them testable without third party dependencies. The best way of doing this is using delegates that we can provide in the class’s constructor and then configure them while testing. Let’s find out how to do that but first… What is untestable code? There are some things that makes our code untestable such as: Not programming to interfaces Newing up objects instead of using IOC Not using dependency injection As programmers we can take some steps to reduce or even eliminate these scenarios....

February 2, 2021 · Hasan Hasanov