diff --git a/Source/aweXpect/That/DateOnlys/ThatDateOnly.IsBetween.cs b/Source/aweXpect/That/DateOnlys/ThatDateOnly.IsBetween.cs index c730a7e40b..989857ba90 100644 --- a/Source/aweXpect/That/DateOnlys/ThatDateOnly.IsBetween.cs +++ b/Source/aweXpect/That/DateOnlys/ThatDateOnly.IsBetween.cs @@ -31,6 +31,7 @@ public static partial class ThatDateOnly /// /// Verifies that the subject is not between the … /// + [GuaranteesNotNull] public static BetweenResult>, DateOnly?> IsNotBetween( this IThat source, DateOnly? minimum) diff --git a/Source/aweXpect/That/DateOnlys/ThatNullableDateOnly.IsBetween.cs b/Source/aweXpect/That/DateOnlys/ThatNullableDateOnly.IsBetween.cs index d66bd54a68..e746756065 100644 --- a/Source/aweXpect/That/DateOnlys/ThatNullableDateOnly.IsBetween.cs +++ b/Source/aweXpect/That/DateOnlys/ThatNullableDateOnly.IsBetween.cs @@ -31,6 +31,7 @@ public static partial class ThatNullableDateOnly /// /// Verifies that the subject is not between the … /// + [GuaranteesNotNull] public static BetweenResult>, DateOnly?> IsNotBetween( this IThat source, DateOnly? minimum) diff --git a/Source/aweXpect/That/DateTimeOffsets/ThatDateTimeOffset.IsBetween.cs b/Source/aweXpect/That/DateTimeOffsets/ThatDateTimeOffset.IsBetween.cs index 7d1fc4f312..26996a209f 100644 --- a/Source/aweXpect/That/DateTimeOffsets/ThatDateTimeOffset.IsBetween.cs +++ b/Source/aweXpect/That/DateTimeOffsets/ThatDateTimeOffset.IsBetween.cs @@ -30,6 +30,7 @@ public static partial class ThatDateTimeOffset /// /// Verifies that the subject is not between the … /// + [GuaranteesNotNull] public static BetweenResult>, DateTimeOffset?> IsNotBetween( this IThat source, diff --git a/Source/aweXpect/That/DateTimeOffsets/ThatNullableDateTimeOffset.IsBetween.cs b/Source/aweXpect/That/DateTimeOffsets/ThatNullableDateTimeOffset.IsBetween.cs index 56db8e8c17..cead6b03b3 100644 --- a/Source/aweXpect/That/DateTimeOffsets/ThatNullableDateTimeOffset.IsBetween.cs +++ b/Source/aweXpect/That/DateTimeOffsets/ThatNullableDateTimeOffset.IsBetween.cs @@ -31,6 +31,7 @@ public static partial class ThatNullableDateTimeOffset /// /// Verifies that the subject is not between the … /// + [GuaranteesNotNull] public static BetweenResult>, DateTimeOffset?> IsNotBetween( this IThat source, diff --git a/Source/aweXpect/That/DateTimes/ThatDateTime.IsBetween.cs b/Source/aweXpect/That/DateTimes/ThatDateTime.IsBetween.cs index a1639455a2..a519f9f137 100644 --- a/Source/aweXpect/That/DateTimes/ThatDateTime.IsBetween.cs +++ b/Source/aweXpect/That/DateTimes/ThatDateTime.IsBetween.cs @@ -30,6 +30,7 @@ public static partial class ThatDateTime /// /// Verifies that the subject is not between the … /// + [GuaranteesNotNull] public static BetweenResult>, DateTime?> IsNotBetween( this IThat source, DateTime? minimum) diff --git a/Source/aweXpect/That/DateTimes/ThatNullableDateTime.IsBetween.cs b/Source/aweXpect/That/DateTimes/ThatNullableDateTime.IsBetween.cs index b636f1d046..7d2c6617d8 100644 --- a/Source/aweXpect/That/DateTimes/ThatNullableDateTime.IsBetween.cs +++ b/Source/aweXpect/That/DateTimes/ThatNullableDateTime.IsBetween.cs @@ -30,6 +30,7 @@ public static partial class ThatNullableDateTime /// /// Verifies that the subject is not between the … /// + [GuaranteesNotNull] public static BetweenResult>, DateTime?> IsNotBetween( this IThat source, DateTime? minimum) diff --git a/Source/aweXpect/That/Numbers/ThatNumber.IsBetween.cs b/Source/aweXpect/That/Numbers/ThatNumber.IsBetween.cs index 74e3f46c1d..67a683eca9 100644 --- a/Source/aweXpect/That/Numbers/ThatNumber.IsBetween.cs +++ b/Source/aweXpect/That/Numbers/ThatNumber.IsBetween.cs @@ -47,6 +47,7 @@ public static partial class ThatNumber /// /// Verifies that the subject is not between the … /// + [GuaranteesNotNull] public static BetweenResult>, TNumber?> IsNotBetween( this IThat source, TNumber? minimum) where TNumber : struct, INumber @@ -63,6 +64,7 @@ public static partial class ThatNumber /// /// Verifies that the subject is not between the … /// + [GuaranteesNotNull] public static BetweenResult>, TNumber?> IsNotBetween( this IThat source, TNumber? minimum) where TNumber : struct, INumber @@ -139,7 +141,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? => AppendNormalResult(stringBuilder, indentation); } - private sealed class NullableIsInRangeConstraint : ConstraintResult.WithEqualToValue, + private sealed class NullableIsInRangeConstraint : ConstraintResult.WithNotNullValue, IValueConstraint where TNumber : struct, INumber { @@ -151,7 +153,7 @@ public NullableIsInRangeConstraint(string it, ExpectationGrammars grammars, TNumber? minimum, TNumber? maximum, - NumberTolerance options) : base(it, grammars, minimum is null) + NumberTolerance options) : base(it, grammars) { if (maximum < minimum) { @@ -609,6 +611,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, byte?> IsNotBetween( this IThat source, byte? minimum) @@ -625,6 +628,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, sbyte?> IsNotBetween( this IThat source, sbyte? minimum) @@ -641,6 +645,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, short?> IsNotBetween( this IThat source, short? minimum) @@ -657,6 +662,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, ushort?> IsNotBetween( this IThat source, ushort? minimum) @@ -673,6 +679,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, int?> IsNotBetween( this IThat source, int? minimum) @@ -689,6 +696,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, uint?> IsNotBetween( this IThat source, uint? minimum) @@ -705,6 +713,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, long?> IsNotBetween( this IThat source, long? minimum) @@ -721,6 +730,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, ulong?> IsNotBetween( this IThat source, ulong? minimum) @@ -737,6 +747,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, float?> IsNotBetween( this IThat source, float? minimum) @@ -761,6 +772,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, double?> IsNotBetween( this IThat source, double? minimum) @@ -785,6 +797,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, decimal?> IsNotBetween( this IThat source, decimal? minimum) @@ -801,6 +814,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, byte?> IsNotBetween( this IThat source, byte? minimum) @@ -817,6 +831,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, sbyte?> IsNotBetween( this IThat source, sbyte? minimum) @@ -833,6 +848,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, short?> IsNotBetween( this IThat source, short? minimum) @@ -849,6 +865,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, ushort?> IsNotBetween( this IThat source, ushort? minimum) @@ -865,6 +882,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, int?> IsNotBetween( this IThat source, int? minimum) @@ -881,6 +899,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, uint?> IsNotBetween( this IThat source, uint? minimum) @@ -897,6 +916,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, long?> IsNotBetween( this IThat source, long? minimum) @@ -913,6 +933,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, ulong?> IsNotBetween( this IThat source, ulong? minimum) @@ -929,6 +950,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, float?> IsNotBetween( this IThat source, float? minimum) @@ -953,6 +975,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, double?> IsNotBetween( this IThat source, double? minimum) @@ -977,6 +1000,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? /// /// Verifies that the subject is not in the range between the … /// + [GuaranteesNotNull] public static BetweenResult>, decimal?> IsNotBetween( this IThat source, decimal? minimum) @@ -1054,7 +1078,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string? => AppendNormalResult(stringBuilder, indentation); } - private sealed class NullableIsInRangeConstraint : ConstraintResult.WithEqualToValue, + private sealed class NullableIsInRangeConstraint : ConstraintResult.WithNotNullValue, IValueConstraint where TNumber : struct, IComparable { @@ -1066,7 +1090,7 @@ public NullableIsInRangeConstraint(string it, ExpectationGrammars grammars, TNumber? minimum, TNumber? maximum, - NumberTolerance options) : base(it, grammars, minimum is null) + NumberTolerance options) : base(it, grammars) { if (maximum != null && minimum != null && maximum.Value.CompareTo(minimum.Value) < 0) diff --git a/Source/aweXpect/That/TimeOnlys/ThatNullableTimeOnly.IsBetween.cs b/Source/aweXpect/That/TimeOnlys/ThatNullableTimeOnly.IsBetween.cs index 05069a933d..228a9c1f13 100644 --- a/Source/aweXpect/That/TimeOnlys/ThatNullableTimeOnly.IsBetween.cs +++ b/Source/aweXpect/That/TimeOnlys/ThatNullableTimeOnly.IsBetween.cs @@ -31,6 +31,7 @@ public static partial class ThatNullableTimeOnly /// /// Verifies that the subject is not between the … /// + [GuaranteesNotNull] public static BetweenResult>, TimeOnly?> IsNotBetween( this IThat source, TimeOnly? minimum) diff --git a/Source/aweXpect/That/TimeOnlys/ThatTimeOnly.IsBetween.cs b/Source/aweXpect/That/TimeOnlys/ThatTimeOnly.IsBetween.cs index 3fdf6fbe84..df6be28d74 100644 --- a/Source/aweXpect/That/TimeOnlys/ThatTimeOnly.IsBetween.cs +++ b/Source/aweXpect/That/TimeOnlys/ThatTimeOnly.IsBetween.cs @@ -31,6 +31,7 @@ public static partial class ThatTimeOnly /// /// Verifies that the subject is not between the … /// + [GuaranteesNotNull] public static BetweenResult>, TimeOnly?> IsNotBetween( this IThat source, TimeOnly? minimum) diff --git a/Source/aweXpect/That/TimeSpans/ThatNullableTimeSpan.IsBetween.cs b/Source/aweXpect/That/TimeSpans/ThatNullableTimeSpan.IsBetween.cs index 3b43250b41..93576ae8b4 100644 --- a/Source/aweXpect/That/TimeSpans/ThatNullableTimeSpan.IsBetween.cs +++ b/Source/aweXpect/That/TimeSpans/ThatNullableTimeSpan.IsBetween.cs @@ -30,6 +30,7 @@ public static partial class ThatNullableTimeSpan /// /// Verifies that the subject is not between the … /// + [GuaranteesNotNull] public static BetweenResult>, TimeSpan?> IsNotBetween( this IThat source, TimeSpan? minimum) diff --git a/Source/aweXpect/That/TimeSpans/ThatTimeSpan.IsBetween.cs b/Source/aweXpect/That/TimeSpans/ThatTimeSpan.IsBetween.cs index fd92d14029..f015248086 100644 --- a/Source/aweXpect/That/TimeSpans/ThatTimeSpan.IsBetween.cs +++ b/Source/aweXpect/That/TimeSpans/ThatTimeSpan.IsBetween.cs @@ -30,6 +30,7 @@ public static partial class ThatTimeSpan /// /// Verifies that the subject is not between the … /// + [GuaranteesNotNull] public static BetweenResult>, TimeSpan?> IsNotBetween( this IThat source, TimeSpan? minimum) diff --git a/Tests/aweXpect.Api.Tests/Expected/aweXpect_net10.0.txt b/Tests/aweXpect.Api.Tests/Expected/aweXpect_net10.0.txt index 3b849509ce..6c03c80810 100644 --- a/Tests/aweXpect.Api.Tests/Expected/aweXpect_net10.0.txt +++ b/Tests/aweXpect.Api.Tests/Expected/aweXpect_net10.0.txt @@ -309,6 +309,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.DateOnly? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.DateOnly? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.DateOnly?> IsNotBetween(this aweXpect.Core.IThat source, System.DateOnly? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.DateOnly? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -347,6 +348,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.DateTime? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.DateTime? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.DateTime?> IsNotBetween(this aweXpect.Core.IThat source, System.DateTime? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.DateTime? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -385,6 +387,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.DateTimeOffset? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.DateTimeOffset? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.DateTimeOffset?> IsNotBetween(this aweXpect.Core.IThat source, System.DateTimeOffset? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.DateTimeOffset? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -1194,6 +1197,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.DateOnly? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.DateOnly? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.DateOnly?> IsNotBetween(this aweXpect.Core.IThat source, System.DateOnly? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.DateOnly? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -1240,6 +1244,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.DateTime? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.DateTime? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.DateTime?> IsNotBetween(this aweXpect.Core.IThat source, System.DateTime? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.DateTime? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -1286,6 +1291,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.DateTimeOffset? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.DateTimeOffset? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.DateTimeOffset?> IsNotBetween(this aweXpect.Core.IThat source, System.DateTimeOffset? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.DateTimeOffset? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -1373,6 +1379,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.TimeOnly? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.TimeOnly? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.TimeOnly?> IsNotBetween(this aweXpect.Core.IThat source, System.TimeOnly? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.TimeOnly? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -1405,6 +1412,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsLessThanOrEqualTo(this aweXpect.Core.IThat source, System.TimeSpan? expected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.AndOrResult> IsNegative(this aweXpect.Core.IThat source) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.TimeSpan?> IsNotBetween(this aweXpect.Core.IThat source, System.TimeSpan? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.TimeSpan? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -1488,8 +1496,10 @@ namespace aweXpect [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.AndOrResult> IsNegative(this aweXpect.Core.IThat source) where TNumber : struct, System.Numerics.INumber { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, TNumber?> IsNotBetween(this aweXpect.Core.IThat source, TNumber? minimum) where TNumber : struct, System.Numerics.INumber { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, TNumber?> IsNotBetween(this aweXpect.Core.IThat source, TNumber? minimum) where TNumber : struct, System.Numerics.INumber { } public static aweXpect.Results.NumberToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, TNumber? unexpected) @@ -1782,6 +1792,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.TimeOnly? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.TimeOnly? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.TimeOnly?> IsNotBetween(this aweXpect.Core.IThat source, System.TimeOnly? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.TimeOnly? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -1814,6 +1825,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsLessThanOrEqualTo(this aweXpect.Core.IThat source, System.TimeSpan? expected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.AndOrResult> IsNegative(this aweXpect.Core.IThat source) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.TimeSpan?> IsNotBetween(this aweXpect.Core.IThat source, System.TimeSpan? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.TimeSpan? unexpected) { } [aweXpect.Core.GuaranteesNotNull] diff --git a/Tests/aweXpect.Api.Tests/Expected/aweXpect_net8.0.txt b/Tests/aweXpect.Api.Tests/Expected/aweXpect_net8.0.txt index f408317bf5..7f55525777 100644 --- a/Tests/aweXpect.Api.Tests/Expected/aweXpect_net8.0.txt +++ b/Tests/aweXpect.Api.Tests/Expected/aweXpect_net8.0.txt @@ -309,6 +309,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.DateOnly? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.DateOnly? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.DateOnly?> IsNotBetween(this aweXpect.Core.IThat source, System.DateOnly? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.DateOnly? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -347,6 +348,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.DateTime? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.DateTime? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.DateTime?> IsNotBetween(this aweXpect.Core.IThat source, System.DateTime? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.DateTime? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -385,6 +387,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.DateTimeOffset? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.DateTimeOffset? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.DateTimeOffset?> IsNotBetween(this aweXpect.Core.IThat source, System.DateTimeOffset? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.DateTimeOffset? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -1194,6 +1197,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.DateOnly? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.DateOnly? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.DateOnly?> IsNotBetween(this aweXpect.Core.IThat source, System.DateOnly? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.DateOnly? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -1240,6 +1244,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.DateTime? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.DateTime? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.DateTime?> IsNotBetween(this aweXpect.Core.IThat source, System.DateTime? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.DateTime? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -1286,6 +1291,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.DateTimeOffset? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.DateTimeOffset? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.DateTimeOffset?> IsNotBetween(this aweXpect.Core.IThat source, System.DateTimeOffset? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.DateTimeOffset? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -1373,6 +1379,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.TimeOnly? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.TimeOnly? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.TimeOnly?> IsNotBetween(this aweXpect.Core.IThat source, System.TimeOnly? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.TimeOnly? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -1405,6 +1412,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsLessThanOrEqualTo(this aweXpect.Core.IThat source, System.TimeSpan? expected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.AndOrResult> IsNegative(this aweXpect.Core.IThat source) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.TimeSpan?> IsNotBetween(this aweXpect.Core.IThat source, System.TimeSpan? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.TimeSpan? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -1488,8 +1496,10 @@ namespace aweXpect [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.AndOrResult> IsNegative(this aweXpect.Core.IThat source) where TNumber : struct, System.Numerics.INumber { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, TNumber?> IsNotBetween(this aweXpect.Core.IThat source, TNumber? minimum) where TNumber : struct, System.Numerics.INumber { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, TNumber?> IsNotBetween(this aweXpect.Core.IThat source, TNumber? minimum) where TNumber : struct, System.Numerics.INumber { } public static aweXpect.Results.NumberToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, TNumber? unexpected) @@ -1782,6 +1792,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.TimeOnly? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.TimeOnly? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.TimeOnly?> IsNotBetween(this aweXpect.Core.IThat source, System.TimeOnly? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.TimeOnly? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -1814,6 +1825,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsLessThanOrEqualTo(this aweXpect.Core.IThat source, System.TimeSpan? expected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.AndOrResult> IsNegative(this aweXpect.Core.IThat source) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.TimeSpan?> IsNotBetween(this aweXpect.Core.IThat source, System.TimeSpan? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.TimeSpan? unexpected) { } [aweXpect.Core.GuaranteesNotNull] diff --git a/Tests/aweXpect.Api.Tests/Expected/aweXpect_netstandard2.0.txt b/Tests/aweXpect.Api.Tests/Expected/aweXpect_netstandard2.0.txt index 077498bcbb..553e7dcdee 100644 --- a/Tests/aweXpect.Api.Tests/Expected/aweXpect_netstandard2.0.txt +++ b/Tests/aweXpect.Api.Tests/Expected/aweXpect_netstandard2.0.txt @@ -88,6 +88,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.DateTime? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.DateTime? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.DateTime?> IsNotBetween(this aweXpect.Core.IThat source, System.DateTime? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.DateTime? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -126,6 +127,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.DateTimeOffset? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.DateTimeOffset? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.DateTimeOffset?> IsNotBetween(this aweXpect.Core.IThat source, System.DateTimeOffset? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.DateTimeOffset? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -803,6 +805,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.DateTime? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.DateTime? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.DateTime?> IsNotBetween(this aweXpect.Core.IThat source, System.DateTime? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.DateTime? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -849,6 +852,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsNotAfter(this aweXpect.Core.IThat source, System.DateTimeOffset? unexpected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.TimeToleranceResult> IsNotBefore(this aweXpect.Core.IThat source, System.DateTimeOffset? unexpected) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.DateTimeOffset?> IsNotBetween(this aweXpect.Core.IThat source, System.DateTimeOffset? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.DateTimeOffset? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -930,6 +934,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsLessThanOrEqualTo(this aweXpect.Core.IThat source, System.TimeSpan? expected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.AndOrResult> IsNegative(this aweXpect.Core.IThat source) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.TimeSpan?> IsNotBetween(this aweXpect.Core.IThat source, System.TimeSpan? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.TimeSpan? unexpected) { } [aweXpect.Core.GuaranteesNotNull] @@ -1249,27 +1254,49 @@ namespace aweXpect public static aweXpect.Results.AndOrResult> IsNegative(this aweXpect.Core.IThat source) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.AndOrResult> IsNegative(this aweXpect.Core.IThat source) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, byte?> IsNotBetween(this aweXpect.Core.IThat source, byte? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, byte?> IsNotBetween(this aweXpect.Core.IThat source, byte? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, decimal?> IsNotBetween(this aweXpect.Core.IThat source, decimal? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, decimal?> IsNotBetween(this aweXpect.Core.IThat source, decimal? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, double?> IsNotBetween(this aweXpect.Core.IThat source, double? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, double?> IsNotBetween(this aweXpect.Core.IThat source, double? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, float?> IsNotBetween(this aweXpect.Core.IThat source, float? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, float?> IsNotBetween(this aweXpect.Core.IThat source, float? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, int?> IsNotBetween(this aweXpect.Core.IThat source, int? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, int?> IsNotBetween(this aweXpect.Core.IThat source, int? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, long?> IsNotBetween(this aweXpect.Core.IThat source, long? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, long?> IsNotBetween(this aweXpect.Core.IThat source, long? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, sbyte?> IsNotBetween(this aweXpect.Core.IThat source, sbyte? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, sbyte?> IsNotBetween(this aweXpect.Core.IThat source, sbyte? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, short?> IsNotBetween(this aweXpect.Core.IThat source, short? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, short?> IsNotBetween(this aweXpect.Core.IThat source, short? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, uint?> IsNotBetween(this aweXpect.Core.IThat source, uint? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, uint?> IsNotBetween(this aweXpect.Core.IThat source, uint? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, ulong?> IsNotBetween(this aweXpect.Core.IThat source, ulong? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, ulong?> IsNotBetween(this aweXpect.Core.IThat source, ulong? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, ushort?> IsNotBetween(this aweXpect.Core.IThat source, ushort? minimum) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, ushort?> IsNotBetween(this aweXpect.Core.IThat source, ushort? minimum) { } public static aweXpect.Results.NumberToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, byte? unexpected) { } public static aweXpect.Results.NullableNumberToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, byte? unexpected) { } @@ -1689,6 +1716,7 @@ namespace aweXpect public static aweXpect.Results.TimeToleranceResult> IsLessThanOrEqualTo(this aweXpect.Core.IThat source, System.TimeSpan? expected) { } [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.AndOrResult> IsNegative(this aweXpect.Core.IThat source) { } + [aweXpect.Core.GuaranteesNotNull] public static aweXpect.Results.BetweenResult>, System.TimeSpan?> IsNotBetween(this aweXpect.Core.IThat source, System.TimeSpan? minimum) { } public static aweXpect.Results.TimeToleranceResult> IsNotEqualTo(this aweXpect.Core.IThat source, System.TimeSpan? unexpected) { } [aweXpect.Core.GuaranteesNotNull] diff --git a/Tests/aweXpect.Tests/GuaranteesNotNullTests.cs b/Tests/aweXpect.Tests/GuaranteesNotNullTests.cs index d398dcc028..a30c018d44 100644 --- a/Tests/aweXpect.Tests/GuaranteesNotNullTests.cs +++ b/Tests/aweXpect.Tests/GuaranteesNotNullTests.cs @@ -101,7 +101,6 @@ await That(skipped.Where(type => type.Assembly == typeof(GuaranteesNotNullTests) "Eventually", "IsEqualTo", "IsEquivalentTo", - "IsNotBetween", "IsNotEqualTo", "IsNotEquivalentTo", "IsNotOneOf", diff --git a/Tests/aweXpect.Tests/Numbers/ThatNumber.IsNotBetween.Tests.cs b/Tests/aweXpect.Tests/Numbers/ThatNumber.IsNotBetween.Tests.cs index 7cbfd8781d..8e2d6928dd 100644 --- a/Tests/aweXpect.Tests/Numbers/ThatNumber.IsNotBetween.Tests.cs +++ b/Tests/aweXpect.Tests/Numbers/ThatNumber.IsNotBetween.Tests.cs @@ -368,7 +368,7 @@ Expected that subject } [Fact] - public async Task ForNullableByte_WhenValueIsNull_ShouldSucceed() + public async Task ForNullableByte_WhenValueIsNull_ShouldFail() { byte? subject = null; byte minimum = 1; @@ -377,7 +377,12 @@ public async Task ForNullableByte_WhenValueIsNull_ShouldSucceed() async Task Act() => await That(subject).IsNotBetween(minimum).And(maximum); - await That(Act).DoesNotThrow(); + await That(Act).Throws() + .WithMessage($""" + Expected that subject + is not between {Formatter.Format(minimum)} and {Formatter.Format(maximum)}, + but it was + """); } [Theory] @@ -579,7 +584,7 @@ Expected that subject } [Fact] - public async Task ForNullableInt_WhenValueIsNull_ShouldSucceed() + public async Task ForNullableInt_WhenValueIsNull_ShouldFail() { int? subject = null; int minimum = 1; @@ -588,7 +593,12 @@ public async Task ForNullableInt_WhenValueIsNull_ShouldSucceed() async Task Act() => await That(subject).IsNotBetween(minimum).And(maximum); - await That(Act).DoesNotThrow(); + await That(Act).Throws() + .WithMessage($""" + Expected that subject + is not between {Formatter.Format(minimum)} and {Formatter.Format(maximum)}, + but it was + """); } [Theory] @@ -695,7 +705,7 @@ Expected that subject } [Fact] - public async Task ForNullableLong_WhenValueIsNull_ShouldSucceed() + public async Task ForNullableLong_WhenValueIsNull_ShouldFail() { long? subject = null; long minimum = 1; @@ -704,7 +714,12 @@ public async Task ForNullableLong_WhenValueIsNull_ShouldSucceed() async Task Act() => await That(subject).IsNotBetween(minimum).And(maximum); - await That(Act).DoesNotThrow(); + await That(Act).Throws() + .WithMessage($""" + Expected that subject + is not between {Formatter.Format(minimum)} and {Formatter.Format(maximum)}, + but it was + """); } [Theory] @@ -738,7 +753,7 @@ Expected that subject } [Fact] - public async Task ForNullableSbyte_WhenValueIsNull_ShouldSucceed() + public async Task ForNullableSbyte_WhenValueIsNull_ShouldFail() { sbyte? subject = null; sbyte minimum = 1; @@ -747,7 +762,12 @@ public async Task ForNullableSbyte_WhenValueIsNull_ShouldSucceed() async Task Act() => await That(subject).IsNotBetween(minimum).And(maximum); - await That(Act).DoesNotThrow(); + await That(Act).Throws() + .WithMessage($""" + Expected that subject + is not between {Formatter.Format(minimum)} and {Formatter.Format(maximum)}, + but it was + """); } [Theory] @@ -781,7 +801,7 @@ Expected that subject } [Fact] - public async Task ForNullableShort_WhenValueIsNull_ShouldSucceed() + public async Task ForNullableShort_WhenValueIsNull_ShouldFail() { short? subject = null; short minimum = 1; @@ -790,7 +810,12 @@ public async Task ForNullableShort_WhenValueIsNull_ShouldSucceed() async Task Act() => await That(subject).IsNotBetween(minimum).And(maximum); - await That(Act).DoesNotThrow(); + await That(Act).Throws() + .WithMessage($""" + Expected that subject + is not between {Formatter.Format(minimum)} and {Formatter.Format(maximum)}, + but it was + """); } [Theory] @@ -824,7 +849,7 @@ Expected that subject } [Fact] - public async Task ForNullableUint_WhenValueIsNull_ShouldSucceed() + public async Task ForNullableUint_WhenValueIsNull_ShouldFail() { uint? subject = null; uint minimum = 1; @@ -833,7 +858,12 @@ public async Task ForNullableUint_WhenValueIsNull_ShouldSucceed() async Task Act() => await That(subject).IsNotBetween(minimum).And(maximum); - await That(Act).DoesNotThrow(); + await That(Act).Throws() + .WithMessage($""" + Expected that subject + is not between {Formatter.Format(minimum)} and {Formatter.Format(maximum)}, + but it was + """); } [Theory] @@ -867,7 +897,7 @@ Expected that subject } [Fact] - public async Task ForNullableUlong_WhenValueIsNull_ShouldSucceed() + public async Task ForNullableUlong_WhenValueIsNull_ShouldFail() { ulong? subject = null; ulong minimum = 1; @@ -876,7 +906,12 @@ public async Task ForNullableUlong_WhenValueIsNull_ShouldSucceed() async Task Act() => await That(subject).IsNotBetween(minimum).And(maximum); - await That(Act).DoesNotThrow(); + await That(Act).Throws() + .WithMessage($""" + Expected that subject + is not between {Formatter.Format(minimum)} and {Formatter.Format(maximum)}, + but it was + """); } [Theory] @@ -910,7 +945,7 @@ Expected that subject } [Fact] - public async Task ForNullableUshort_WhenValueIsNull_ShouldSucceed() + public async Task ForNullableUshort_WhenValueIsNull_ShouldFail() { ushort? subject = null; ushort minimum = 1; @@ -919,7 +954,12 @@ public async Task ForNullableUshort_WhenValueIsNull_ShouldSucceed() async Task Act() => await That(subject).IsNotBetween(minimum).And(maximum); - await That(Act).DoesNotThrow(); + await That(Act).Throws() + .WithMessage($""" + Expected that subject + is not between {Formatter.Format(minimum)} and {Formatter.Format(maximum)}, + but it was + """); } [Theory]