Share via


Assert.IsGreaterThan Method

Definition

Overloads

IsGreaterThan<T>(T, T, String)

Tests whether the value is greater than the lower bound and throws an exception if it is not.

IsGreaterThan<T>(T, T, String, String, String)

Tests whether the value is greater than the lower bound and throws an exception if it is not.

IsGreaterThan<T>(T, T, String)

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

Tests whether the value is greater than the lower bound and throws an exception if it is not.

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

Type Parameters

T

The type of values to compare.

Parameters

lowerBound
T

The lower bound value that the value should 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 greater than lowerBound. The message is shown in test results.

Exceptions

Thrown if value is not greater than lowerBound.

Applies to

IsGreaterThan<T>(T, T, String, String, String)

Source:
Assert.IComparable.cs

Tests whether the value is greater than the lower bound and throws an exception if it is not.

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

Type Parameters

T

The type of values to compare.

Parameters

lowerBound
T

The lower bound value that the value should 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 greater than lowerBound. The message is shown in test results.

lowerBoundExpression
String

The syntactic expression of lowerBound 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 greater than lowerBound.

Applies to