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
actualTThe actual value to be evaluated
lowTThe (inclusive) low value of the range
highTThe (inclusive) high value of the range
Type Parameters
TThe 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
actualTThe actual value to be evaluated
lowTThe (inclusive) low value of the range
highTThe (inclusive) high value of the range
comparerIComparer<T>The comparer used to evaluate the value's range
Type Parameters
TThe type of the value to be compared
Exceptions
Thrown when the value is not in the given range