Class ComparableAssertExtensions
Defines a code assertion helper for IComparable based scenarios.
public static class ComparableAssertExtensions
- Inheritance
-
ComparableAssertExtensions
- Inherited Members
Methods
ShouldBeGreaterThanOrEqualTo<T>(T, T)
Tests whether the specified value is greater than or equal to the given threshold and throws an exception if it is not.
public static void ShouldBeGreaterThanOrEqualTo<T>(this T value, T threshold) where T : IComparable<T>
Parameters
valueTThe value to test.
thresholdTThe threshold value that the
valueshould be greater than or equal to.
Type Parameters
TThe type of value to compare.
Exceptions
- AssertFailedException
Thrown if the
valueis less than thethreshold.
ShouldBeGreaterThan<T>(T, T)
Tests whether the specified value is greater than the given threshold and throws an exception if it is not.
public static void ShouldBeGreaterThan<T>(this T value, T threshold) where T : IComparable<T>
Parameters
valueTThe value to test.
thresholdTThe threshold value that the
valueshould be greater than.
Type Parameters
TThe type of value to compare.
Exceptions
- AssertFailedException
Thrown if the
valueis not greater than thethreshold.
ShouldBeLessThanOrEqualTo<T>(T, T)
Tests whether the specified value is less than or equal to the given threshold and throws an exception if it is not.
public static void ShouldBeLessThanOrEqualTo<T>(this T value, T threshold) where T : IComparable<T>
Parameters
valueTThe value to test.
thresholdTThe threshold value that the
valueshould be less than or equal to.
Type Parameters
TThe type of value to compare.
Exceptions
- AssertFailedException
Thrown if the
valueis greater than thethreshold.
ShouldBeLessThan<T>(T, T)
Tests whether the specified value is less than the given threshold and throws an exception if it is not.
public static void ShouldBeLessThan<T>(this T value, T threshold) where T : IComparable<T>
Parameters
valueTThe value to test.
thresholdTThe threshold value that the
valueshould be less than.
Type Parameters
TThe type of value to compare.
Exceptions
- AssertFailedException
Thrown if the
valueis not less than thethreshold.