Fully Covering .NET C# Console Application With Unit Tests
Best Practice to achieve 100% coverage using Test Driven Development (TDD), Dependency Injection (DI), Inversion of Control (IoC), and IoC Containers.
Some colleagues of mine are complaining that sometimes they are not able to apply TDD or write unit tests for some modules or applications, Console Applications are one of these.
How could I test a Console application when the input is passed by keystrokes and the output is presented on a screen?!!
Actually, this happens from time to time, you find yourself trying to write unit tests for something you seem to not have any control over.
The truth is, you just missed the point. You don’t need to test the “Console” application, you want to test the business logic behind it.