Skip to content

DateTime utility library for easier testing in unit test or integration test.

License

Notifications You must be signed in to change notification settings

GranDen-Corp/GranDen.TimeLib.ClockShaft

Repository files navigation

GranDen Time-related testing library

Build Status

GranDen.TimeLib.ClockShaft

Nuget

DateTime utility library for easier testing in unit test or integration test, naming by the shaft mechanical part of clock:

Clock diagram

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.

GranDen.TimeLib.ClockShaft.Options

Nuget

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.

Demo Web App