-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Practical Test-Driven Development using C# 7
By :

There are a variety of telltale signs that an application, class, or method will be difficult, or even impossible, to test. Sure, there are ways around some of the following examples but it's usually best to just avoid workarounds and programmatic acrobatics. Simple is usually best, and your future self and/or future maintainers will thank you for keeping things simple.
If you're creating instances of external resources within your constructors or inside methods instead of having them passed in, it will be very difficult to write tests to cover these classes and methods. Generally, in today's modern applications, Dependency Injection frameworks are used to create and provide the external dependencies to a class. Many choose to define an interface as the contract for the dependency, providing a more flexible method for testing and the coupling to external resources.
You may have a need to access static third-party classes or methods. Instead of accessing...
Change the font size
Change margin width
Change background colour