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.
#r "nuget: Xtensible.Time.Clock, 1.1.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Xtensible.Time.Clock as a Cake Addin
#addin nuget:?package=Xtensible.Time.Clock&version=1.1.0

// Install Xtensible.Time.Clock as a Cake Tool
#tool nuget:?package=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

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Xtensible.Time.Clock:

Package Downloads
TableStorage.Abstractions.POCO
A repository wrapper for Azure Table Storage that uses POCOs (Plain Old CLR Objects) instead of objects that implemeent ITableEntity. The Azure Storage SDK requires that objects that it works with to implement the ITableEntity interface. This puts us into one of two places that are often not desirable: You implement the ITableEntity interace, or inherit from TableEntity. This is easy, but now you've got a leaky abstraction, as well as properties that won't make much sense in your domain (e.g. instead of a UserId, you've now got a RowKey, of the wrong type), or you have fields that are out of place, like ETag and Timestamp. You create DTOs to save to ship data back and forth from the domain to Table Storage. This is a common style, but often is overkill, especially if we're just looking for a simple abstraction on top of Azure Table Storage. This simple library seeks to take care of the mapping for us, so that you can continue to write your domain objects as POCOs, while still being able to leverage the Azure Storage SDK. The library will convert simple properties to fields in Azure Table Storage. Complex types will serialize as json.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.0 1,311 6/19/2019
1.0.3 215 6/16/2019
1.0.2 240 6/14/2019