From 6f9b214d7774f5c3ed0dff165f1d05fcf59b1493 Mon Sep 17 00:00:00 2001 From: Jezz Santos Date: Wed, 23 Oct 2024 17:38:47 +1300 Subject: [PATCH] Fixed IsNear testing method --- src/UnitTesting.Common/OptionalExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/UnitTesting.Common/OptionalExtensions.cs b/src/UnitTesting.Common/OptionalExtensions.cs index 0f89ed4f..cc5fc46d 100644 --- a/src/UnitTesting.Common/OptionalExtensions.cs +++ b/src/UnitTesting.Common/OptionalExtensions.cs @@ -8,9 +8,9 @@ namespace UnitTesting.Common; public static class OptionalExtensions { public static AndConstraint BeNear(this OptionalAssertions assertions, - DateTime nearbyTime, int precision = 850, string because = "", params object[] becauseArgs) + Optional nearbyTime, int precision = 850, string because = "", params object[] becauseArgs) { - return new DateTimeAssertions(!assertions.Subject.HasValue + return new DateTimeAssertions(assertions.Subject.HasValue ? assertions.Subject.Value : null) .BeNear(nearbyTime, TimeSpan.FromMilliseconds(precision), because, becauseArgs);