Table of Contents

Class ComparableAssertExtensions

Namespace
MADE.Testing
Assembly
MADE.Testing.dll

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

value T

The value to test.

threshold T

The threshold value that the value should be greater than or equal to.

Type Parameters

T

The type of value to compare.

Exceptions

AssertFailedException

Thrown if the value is less than the threshold.

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

value T

The value to test.

threshold T

The threshold value that the value should be greater than.

Type Parameters

T

The type of value to compare.

Exceptions

AssertFailedException

Thrown if the value is not greater than the threshold.

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

value T

The value to test.

threshold T

The threshold value that the value should be less than or equal to.

Type Parameters

T

The type of value to compare.

Exceptions

AssertFailedException

Thrown if the value is greater than the threshold.

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

value T

The value to test.

threshold T

The threshold value that the value should be less than.

Type Parameters

T

The type of value to compare.

Exceptions

AssertFailedException

Thrown if the value is not less than the threshold.