diff --git a/Creek.HelpfulExtensions/Creek.HelpfulExtensions.csproj b/Creek.HelpfulExtensions/Creek.HelpfulExtensions.csproj index d8f6643..7319ab3 100644 --- a/Creek.HelpfulExtensions/Creek.HelpfulExtensions.csproj +++ b/Creek.HelpfulExtensions/Creek.HelpfulExtensions.csproj @@ -19,8 +19,8 @@ LICENSE git creek - 1.1.0 - 1.1.0.0 + 1.2.0 + 1.2.0.0 diff --git a/Creek.HelpfulExtensions/SystemTime.cs b/Creek.HelpfulExtensions/SystemTime.cs new file mode 100644 index 0000000..44ac2e8 --- /dev/null +++ b/Creek.HelpfulExtensions/SystemTime.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Creek.HelpfulExtensions +{ + public static class SystemTime + { + /// + /// This method exposes DateTime.Now as an instance of a function, that can be replaced in tests. + /// +#pragma warning disable S1104 // Fields should not have public accessibility +#pragma warning disable S2223 // Non-constant static fields should not be visible + public static Func Now = () => DateTime.Now; +#pragma warning restore S2223 // Non-constant static fields should not be visible +#pragma warning restore S1104 // Fields should not have public accessibility + } +}