Are your unit tests failing because the code-under-test is coupled to the system clock? In other words, does the method you are testing use the System.DateTime.Now property, and that dependency is making it hard to properly unit test the code?
This series of posts presents four ways to fake time as a means of improving testability. Specifically, we'll look at these four techniques:
The Optional 'clock' ParameterBrute Force Property InjectionInject The IClock InterfaceMock Isolation FrameworkTim...
Published on January 26, 2012 07:11