I have a fairly large code base sprinkled with a bunch of DateTime.UtcNow, many other calls and TimeSpans, etc.
Now we are introducing tasks with timers, etc and I need to run the system at a variable speed to debug, like a day is 5 minutes, etc.
Since there are a lot of things depending on time and I can't change the logic everywhere, I can do two things:
- Create a fake assembly in Visual Studio so I replace DateTime; Or,
- I can simply change all the DateTime calls to my own class which would normally just return results from DateTime.
But, ultimately, it boils down to writing a replacement of DateTime and since the code is using more than DateTime.UtcNow, I would like to find a existing solution if possible.
Does anyone know if such a thing exists? I haven't found anything so far