Static classes and unit testing

If you unit test your code (and I hope you do), you’ll quickly discover that you need to mock out parts of the system. This is much easier if you design with testability in mind from the start of the project. In particular, as you’ll see, you need to be very careful about where you use static classes.