Unit Testing: DateTime.Now

I have some unit tests that expects the ‘current time’ to be different than DateTime.Now and I don’t want to change the computer’s time, obviously.

What’s the best strategy to achieve this?

22 Answers
22

Leave a Comment