We have an application which uses the current date (using Datetime.Now) to calculate specific values.
We need to be able to run these calculations on the server based on a different date as well. Unfortunately the two obvious choices are not viable -
a) although we have the code for the app, due to politics and the fact that other environments also use the service, will not be able to change it and inject a specific date and
b) due to other applications and processes running on the server we cannot change the system date.
What I was wondering was:
would it be possible to intercept calls made to the framework (Datetime.Now in this case) and return a specific value? This can be from either the same application or not. Unfortunately I'm not sure if you can actually intercept these calls in this way, and even then be able to identify the calling process. I realise you could potentially do this with some testing frameworks, but they will require you to change your codebase in any case.
thanks