This is an add-in for Fody
Ionad replaces static types with your own.
https://nuget.org/packages/Ionad.Fody/
PM> Install-Package Ionad.Fody
[StaticReplacement(typeof(DateTime))]
public static class DateTimeSubstitute
{
public static IDateTime Current { get; set; }
public static DateTime Now { get { return Current.Now; } }
}
public void SomeMethod()
{
var time = DateTime.Now;
// ...
}
public void SomeMethod()
{
var time = DateTimeSubstitute.Now;
// ...
}
Interchange designed by Laurent Patain from The Noun Project