6

Jesus fucking christ! I've been hired by this bank to improve the quality of their online banking software. Zero unit tests and I'm tasked to make it testable as much as possible.

Guess what? Almost the whole fucking codebase uses static classes everywhere!!! Good luck unit testing that.... what a bummer. It is a challenge though.

Comments
  • 3
    static classes should be very easy to unit test as they should be stateless (If a static class has state then it should be deleted and the developer who wrote it should be thrown on a fire-ant nest).
  • 2
    @ItsNotMyFault The static classes, yes, but the components using those classes are almost impossible to test without major refactoring.

    E.g. an asp.net mvc controller that uses 10 different static classes that each call into a database, live webservice or other component. Thats a huge pain in the ass if you want to unit test that controller.
Add Comment