In Part 1 of this four part series you learned how a code's implicit dependency on the system clock can make the software difficult to test. The first post presented a very simple solution, pass in the clock as a method parameter. It is effective, however, adding a new parameter to every method of a class isn't always the best solution.
Fake Time 2: Brute Force Property Injection
Here is a second way to fake time. It is brute force in the sense that it is rudimentary. Using full-blown...
Published on January 31, 2012 08:59