Skip to content

mdabbagh88/Ionad

 
 

Repository files navigation

This is an add-in for Fody

Ionad Icon - A black circle with 3 arrows forming an outer circle.

Ionad replaces static types with your own.

The nuget package NuGet Status

https://nuget.org/packages/Ionad.Fody/

PM> Install-Package Ionad.Fody

Your Code

[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;
    // ...
}

What gets compiled

public void SomeMethod()
{
    var time = DateTimeSubstitute.Now;
    // ...
}

Contributors

Icon

Interchange designed by Laurent Patain from The Noun Project

About

Replaces static method calls.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 84.8%
  • PostScript 15.2%