Here is a handy class that will help with unit testing any references to DateTime.Now.

public static class SystemTime{

    public static Func<DateTime> Now = () => DateTime.Now();

    public static Func<DateTime> UtcNow = () => DateTime.UtcNow();

    public static Func<DateTimeOffset> OffsetNow = () => DateTimeOffset.Now;


This is helpful when you need to test certain results from DateTime.Now. Instead of referencing DateTime.Now in your code, you would reference SystemTime.Now.

var _date = SystemTime.Now();