Method InRange
- Namespace
- Xunit
- Assembly
- xunit.v3.assert.dll
InRange<T>(T, T, T)
Verifies that a value is within a given range.
public static void InRange<T>(T actual, T low, T high) where T : IComparable
Parameters
actual
TThe actual value to be evaluated
low
TThe (inclusive) low value of the range
high
TThe (inclusive) high value of the range
Type Parameters
T
The type of the value to be compared
Exceptions
Thrown when the value is not in the given range
InRange<T>(T, T, T, IComparer<T>)
Verifies that a value is within a given range, using a comparer.
public static void InRange<T>(T actual, T low, T high, IComparer<T> comparer)
Parameters
actual
TThe actual value to be evaluated
low
TThe (inclusive) low value of the range
high
TThe (inclusive) high value of the range
comparer
IComparer<T>The comparer used to evaluate the value's range
Type Parameters
T
The type of the value to be compared
Exceptions
Thrown when the value is not in the given range