Assert.IsLessThanOrEqualTo Method

Definition

Overloads

IsLessThanOrEqualTo<T>(T, T, String)

Tests whether the value is less than or equal to the upper bound and throws an exception if it is not.

IsLessThanOrEqualTo<T>(T, T, String, String, String)

Tests whether the value is less than or equal to the upper bound and throws an exception if it is not.

IsLessThanOrEqualTo<T>(T, T, String)

Source:
Assert.IComparable.cs
Source:
Assert.IComparable.cs

Tests whether the value is less than or equal to the upper bound and throws an exception if it is not.

public static void IsLessThanOrEqualTo<T>(T upperBound, T value, string message = "") where T : IComparable<T>;
static member IsLessThanOrEqualTo : 'T * 'T * string -> unit (requires 'T :> IComparable<'T>)
Public Shared Sub IsLessThanOrEqualTo(Of T As IComparable(Of T)) (upperBound As T, value As T, Optional message As String = "")

Type Parameters

T

The type of values to compare.

Parameters

upperBound
T

The upper bound value that the value should not exceed.

value
T

The value to compare. This is the value produced by the code under test.

message
String

The message to include in the exception when value is not less than or equal to upperBound. The message is shown in test results.

Exceptions

Thrown if value is not less than or equal to upperBound.

Applies to

IsLessThanOrEqualTo<T>(T, T, String, String, String)

Source:
Assert.IComparable.cs

Tests whether the value is less than or equal to the upper bound and throws an exception if it is not.

public static void IsLessThanOrEqualTo<T>(T upperBound, T value, string? message = "", string upperBoundExpression = "", string valueExpression = "") where T : IComparable<T>;
static member IsLessThanOrEqualTo : 'T * 'T * string * string * string -> unit (requires 'T :> IComparable<'T>)
Public Shared Sub IsLessThanOrEqualTo(Of T As IComparable(Of T)) (upperBound As T, value As T, Optional message As String = "", Optional upperBoundExpression As String = "", Optional valueExpression As String = "")

Type Parameters

T

The type of values to compare.

Parameters

upperBound
T

The upper bound value that the value should not exceed.

value
T

The value to compare. This is the value produced by the code under test.

message
String

The message to include in the exception when value is not less than or equal to upperBound. The message is shown in test results.

upperBoundExpression
String

The syntactic expression of upperBound as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

valueExpression
String

The syntactic expression of value as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

Exceptions

Thrown if value is not less than or equal to upperBound.

Applies to