Xtensible.Time.Clock 1.1.0

An easy to use mockable clock.  Pass WallClock to your services in production/dev code and use MockClock in unit tests; or, if you don't want to pass around a clock, do Clock.Default = new MockClock(); in your unit tests.

Install-Package Xtensible.Time.Clock -Version 1.1.0
dotnet add package Xtensible.Time.Clock --version 1.1.0
<PackageReference Include="Xtensible.Time.Clock" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Xtensible.Time.Clock --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

An easy to use mockable clock. Pass WallClock to your services in production/dev code and use MockClock in unit tests; or, if you don't want to pass around a clock, do Clock.Default = new MockClock(); in your unit tests.

Also includes useful rounding extension (RoundUp, RoundDown, and RoundNearest) that can be used on any DateTime or DateTimeOffset, including the time that comes from Clock.

An easy to use mockable clock. Pass WallClock to your services in production/dev code and use MockClock in unit tests; or, if you don't want to pass around a clock, do Clock.Default = new MockClock(); in your unit tests.

Also includes useful rounding extension (RoundUp, RoundDown, and RoundNearest) that can be used on any DateTime or DateTimeOffset, including the time that comes from Clock.

Release Notes

Added rounding functionality: round up, round down, round nearest

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.0 81 6/19/2019
1.0.3 61 6/16/2019
1.0.2 82 6/14/2019