DateTime utility library for easier testing in unit test or integration test, naming by the shaft mechanical part of clock:
Yoo can define a configure lambda function to customize the behavior like following:
ClockWork.ShaftConfigurationFunc = shaft =>
{
shaft.Backward = true;
shaft.ShiftTimeSpan = new TimeSpan(1, 0, 0);
return shaft;
};
Then when you access the ClockWork.DateTime.Now
static property, it will return the datetime one hour earlier.
Library provides ASP.NET Core Options pattern helper method and class for GranDen.TimeLib.ClockShaft library, see test_sample projects to see how to apply on ASP.NET Core Web and Generic Host project.