diff --git a/src/.run/AllHosts.run.xml b/src/.run/AllHosts.run.xml index b0a86114..a8a9997b 100644 --- a/src/.run/AllHosts.run.xml +++ b/src/.run/AllHosts.run.xml @@ -1,8 +1,14 @@ - - - - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/src/UnitTesting.Common/OptionalExtensions.cs b/src/UnitTesting.Common/OptionalExtensions.cs index f97adf79..0f89ed4f 100644 --- a/src/UnitTesting.Common/OptionalExtensions.cs +++ b/src/UnitTesting.Common/OptionalExtensions.cs @@ -8,9 +8,11 @@ namespace UnitTesting.Common; public static class OptionalExtensions { public static AndConstraint BeNear(this OptionalAssertions assertions, - Optional nearbyTime, int precision = 850, string because = "", params object[] becauseArgs) + DateTime nearbyTime, int precision = 850, string because = "", params object[] becauseArgs) { - return new DateTimeAssertions(nearbyTime.ValueOrDefault) + return new DateTimeAssertions(!assertions.Subject.HasValue + ? assertions.Subject.Value + : null) .BeNear(nearbyTime, TimeSpan.FromMilliseconds(precision), because, becauseArgs); }