Blog Logo
TAGS

Bending DateTime in .NET to Test Your Code Better

Learn how to solve the problem of validating actual time in your code when using DateTime.Now or DateTime.UtcNow. Author Stephen Walsh shares his solution using SimpleDateTimeProvider NuGet Package which consists of an interface and two implementations of the interface, one returning System values and the other returning Mocked values. The article includes code samples for each implementation and tips for using the provider in your functional code. Make testing your code even better with this simple solution. #dotnet #testing #validation #nuget