One example from previous project: In the UI we had an option to search for things that are older than x days/minutes. Basically the server receives call "Give me 10 latests records that are older than 10 minutes". In this case it is easier to test the system when I can mock DateTime.Now.
But basically any code that deals with current time: schedulers, scheduled tasks, different kind of alarms etc. When you write test for the functionality it is pretty easy to spot these. Usually if you don't mock the DateTime.Now it is more difficult to write the test.
But basically any code that deals with current time: schedulers, scheduled tasks, different kind of alarms etc. When you write test for the functionality it is pretty easy to spot these. Usually if you don't mock the DateTime.Now it is more difficult to write the test.