Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Source/aweXpect/That/DateOnlys/ThatDateOnly.IsBetween.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public static partial class ThatDateOnly
/// <summary>
/// Verifies that the subject is not between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<TimeToleranceResult<DateOnly, IThat<DateOnly>>, DateOnly?> IsNotBetween(
this IThat<DateOnly> source,
DateOnly? minimum)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public static partial class ThatNullableDateOnly
/// <summary>
/// Verifies that the subject is not between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<TimeToleranceResult<DateOnly?, IThat<DateOnly?>>, DateOnly?> IsNotBetween(
this IThat<DateOnly?> source,
DateOnly? minimum)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public static partial class ThatDateTimeOffset
/// <summary>
/// Verifies that the subject is not between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<TimeToleranceResult<DateTimeOffset, IThat<DateTimeOffset>>, DateTimeOffset?>
IsNotBetween(
this IThat<DateTimeOffset> source,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public static partial class ThatNullableDateTimeOffset
/// <summary>
/// Verifies that the subject is not between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<TimeToleranceResult<DateTimeOffset?, IThat<DateTimeOffset?>>, DateTimeOffset?>
IsNotBetween(
this IThat<DateTimeOffset?> source,
Expand Down
1 change: 1 addition & 0 deletions Source/aweXpect/That/DateTimes/ThatDateTime.IsBetween.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public static partial class ThatDateTime
/// <summary>
/// Verifies that the subject is not between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<TimeToleranceResult<DateTime, IThat<DateTime>>, DateTime?> IsNotBetween(
this IThat<DateTime> source,
DateTime? minimum)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public static partial class ThatNullableDateTime
/// <summary>
/// Verifies that the subject is not between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<TimeToleranceResult<DateTime?, IThat<DateTime?>>, DateTime?> IsNotBetween(
this IThat<DateTime?> source,
DateTime? minimum)
Expand Down
32 changes: 28 additions & 4 deletions Source/aweXpect/That/Numbers/ThatNumber.IsBetween.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public static partial class ThatNumber
/// <summary>
/// Verifies that the subject is not between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NumberToleranceResult<TNumber, IThat<TNumber>>, TNumber?> IsNotBetween<TNumber>(
this IThat<TNumber> source, TNumber? minimum)
where TNumber : struct, INumber<TNumber>
Expand All @@ -63,6 +64,7 @@ public static partial class ThatNumber
/// <summary>
/// Verifies that the subject is not between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NullableNumberToleranceResult<TNumber, IThat<TNumber?>>, TNumber?> IsNotBetween<TNumber>(
this IThat<TNumber?> source, TNumber? minimum)
where TNumber : struct, INumber<TNumber>
Expand Down Expand Up @@ -139,7 +141,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
=> AppendNormalResult(stringBuilder, indentation);
}

private sealed class NullableIsInRangeConstraint<TNumber> : ConstraintResult.WithEqualToValue<TNumber?>,
private sealed class NullableIsInRangeConstraint<TNumber> : ConstraintResult.WithNotNullValue<TNumber?>,
IValueConstraint<TNumber?>
where TNumber : struct, INumber<TNumber>
{
Expand All @@ -151,7 +153,7 @@ public NullableIsInRangeConstraint(string it,
ExpectationGrammars grammars,
TNumber? minimum,
TNumber? maximum,
NumberTolerance<TNumber> options) : base(it, grammars, minimum is null)
NumberTolerance<TNumber> options) : base(it, grammars)
{
if (maximum < minimum)
{
Expand Down Expand Up @@ -609,6 +611,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NumberToleranceResult<byte, IThat<byte>>, byte?> IsNotBetween(
this IThat<byte> source,
byte? minimum)
Expand All @@ -625,6 +628,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NumberToleranceResult<sbyte, IThat<sbyte>>, sbyte?> IsNotBetween(
this IThat<sbyte> source,
sbyte? minimum)
Expand All @@ -641,6 +645,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NumberToleranceResult<short, IThat<short>>, short?> IsNotBetween(
this IThat<short> source,
short? minimum)
Expand All @@ -657,6 +662,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NumberToleranceResult<ushort, IThat<ushort>>, ushort?> IsNotBetween(
this IThat<ushort> source,
ushort? minimum)
Expand All @@ -673,6 +679,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NumberToleranceResult<int, IThat<int>>, int?> IsNotBetween(
this IThat<int> source,
int? minimum)
Expand All @@ -689,6 +696,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NumberToleranceResult<uint, IThat<uint>>, uint?> IsNotBetween(
this IThat<uint> source,
uint? minimum)
Expand All @@ -705,6 +713,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NumberToleranceResult<long, IThat<long>>, long?> IsNotBetween(
this IThat<long> source,
long? minimum)
Expand All @@ -721,6 +730,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NumberToleranceResult<ulong, IThat<ulong>>, ulong?> IsNotBetween(
this IThat<ulong> source,
ulong? minimum)
Expand All @@ -737,6 +747,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NumberToleranceResult<float, IThat<float>>, float?> IsNotBetween(
this IThat<float> source,
float? minimum)
Expand All @@ -761,6 +772,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NumberToleranceResult<double, IThat<double>>, double?> IsNotBetween(
this IThat<double> source,
double? minimum)
Expand All @@ -785,6 +797,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NumberToleranceResult<decimal, IThat<decimal>>, decimal?> IsNotBetween(
this IThat<decimal> source,
decimal? minimum)
Expand All @@ -801,6 +814,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NullableNumberToleranceResult<byte, IThat<byte?>>, byte?> IsNotBetween(
this IThat<byte?> source,
byte? minimum)
Expand All @@ -817,6 +831,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NullableNumberToleranceResult<sbyte, IThat<sbyte?>>, sbyte?> IsNotBetween(
this IThat<sbyte?> source,
sbyte? minimum)
Expand All @@ -833,6 +848,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NullableNumberToleranceResult<short, IThat<short?>>, short?> IsNotBetween(
this IThat<short?> source,
short? minimum)
Expand All @@ -849,6 +865,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NullableNumberToleranceResult<ushort, IThat<ushort?>>, ushort?> IsNotBetween(
this IThat<ushort?> source,
ushort? minimum)
Expand All @@ -865,6 +882,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NullableNumberToleranceResult<int, IThat<int?>>, int?> IsNotBetween(
this IThat<int?> source,
int? minimum)
Expand All @@ -881,6 +899,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NullableNumberToleranceResult<uint, IThat<uint?>>, uint?> IsNotBetween(
this IThat<uint?> source,
uint? minimum)
Expand All @@ -897,6 +916,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NullableNumberToleranceResult<long, IThat<long?>>, long?> IsNotBetween(
this IThat<long?> source,
long? minimum)
Expand All @@ -913,6 +933,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NullableNumberToleranceResult<ulong, IThat<ulong?>>, ulong?> IsNotBetween(
this IThat<ulong?> source,
ulong? minimum)
Expand All @@ -929,6 +950,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NullableNumberToleranceResult<float, IThat<float?>>, float?> IsNotBetween(
this IThat<float?> source,
float? minimum)
Expand All @@ -953,6 +975,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NullableNumberToleranceResult<double, IThat<double?>>, double?> IsNotBetween(
this IThat<double?> source,
double? minimum)
Expand All @@ -977,6 +1000,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
/// <summary>
/// Verifies that the subject is not in the range between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<NullableNumberToleranceResult<decimal, IThat<decimal?>>, decimal?> IsNotBetween(
this IThat<decimal?> source,
decimal? minimum)
Expand Down Expand Up @@ -1054,7 +1078,7 @@ protected override void AppendNegatedResult(StringBuilder stringBuilder, string?
=> AppendNormalResult(stringBuilder, indentation);
}

private sealed class NullableIsInRangeConstraint<TNumber> : ConstraintResult.WithEqualToValue<TNumber?>,
private sealed class NullableIsInRangeConstraint<TNumber> : ConstraintResult.WithNotNullValue<TNumber?>,
IValueConstraint<TNumber?>
where TNumber : struct, IComparable<TNumber>
{
Expand All @@ -1066,7 +1090,7 @@ public NullableIsInRangeConstraint(string it,
ExpectationGrammars grammars,
TNumber? minimum,
TNumber? maximum,
NumberTolerance<TNumber> options) : base(it, grammars, minimum is null)
NumberTolerance<TNumber> options) : base(it, grammars)
{
if (maximum != null && minimum != null &&
maximum.Value.CompareTo(minimum.Value) < 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public static partial class ThatNullableTimeOnly
/// <summary>
/// Verifies that the subject is not between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<TimeToleranceResult<TimeOnly?, IThat<TimeOnly?>>, TimeOnly?> IsNotBetween(
this IThat<TimeOnly?> source,
TimeOnly? minimum)
Expand Down
1 change: 1 addition & 0 deletions Source/aweXpect/That/TimeOnlys/ThatTimeOnly.IsBetween.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public static partial class ThatTimeOnly
/// <summary>
/// Verifies that the subject is not between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<TimeToleranceResult<TimeOnly, IThat<TimeOnly>>, TimeOnly?> IsNotBetween(
this IThat<TimeOnly> source,
TimeOnly? minimum)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public static partial class ThatNullableTimeSpan
/// <summary>
/// Verifies that the subject is not between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<TimeToleranceResult<TimeSpan?, IThat<TimeSpan?>>, TimeSpan?> IsNotBetween(
this IThat<TimeSpan?> source,
TimeSpan? minimum)
Expand Down
1 change: 1 addition & 0 deletions Source/aweXpect/That/TimeSpans/ThatTimeSpan.IsBetween.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public static partial class ThatTimeSpan
/// <summary>
/// Verifies that the subject is not between the <paramref name="minimum" />…
/// </summary>
[GuaranteesNotNull]
public static BetweenResult<TimeToleranceResult<TimeSpan, IThat<TimeSpan>>, TimeSpan?> IsNotBetween(
this IThat<TimeSpan> source,
TimeSpan? minimum)
Expand Down
Loading