Share via


Assert.IsInRange Method

Definition

Overloads

IsInRange<T>(T, T, T, String)

Tests whether the specified value is within the expected range (inclusive). The range includes both the minimum and maximum values.

IsInRange<T>(T, T, T, String, String, String, String)

Tests whether the specified value is within the expected range (inclusive). The range includes both the minimum and maximum values.

IsInRange<T>(T, T, T, String)

Source:
Assert.Contains.cs
Source:
Assert.Contains.cs

Tests whether the specified value is within the expected range (inclusive). The range includes both the minimum and maximum values.

public static void IsInRange<T>(T minValue, T maxValue, T value, string message = "") where T : struct;
static member IsInRange : 'T * 'T * 'T * string -> unit (requires 'T : struct)
Public Shared Sub IsInRange(Of T As Structure) (minValue As T, maxValue As T, value As T, Optional message As String = "")

Type Parameters

T

The type of the values to compare.

Parameters

minValue
T

The minimum value of the expected range (inclusive).

maxValue
T

The maximum value of the expected range (inclusive).

value
T

The value to test.

message
String

The message format to display when the assertion fails.

Applies to

IsInRange<T>(T, T, T, String, String, String, String)

Source:
Assert.Contains.cs

Tests whether the specified value is within the expected range (inclusive). The range includes both the minimum and maximum values.

public static void IsInRange<T>(T minValue, T maxValue, T value, string? message = "", string minValueExpression = "", string maxValueExpression = "", string valueExpression = "") where T : struct;
static member IsInRange : 'T * 'T * 'T * string * string * string * string -> unit (requires 'T : struct)
Public Shared Sub IsInRange(Of T As Structure) (minValue As T, maxValue As T, value As T, Optional message As String = "", Optional minValueExpression As String = "", Optional maxValueExpression As String = "", Optional valueExpression As String = "")

Type Parameters

T

The type of the values to compare.

Parameters

minValue
T

The minimum value of the expected range (inclusive).

maxValue
T

The maximum value of the expected range (inclusive).

value
T

The value to test.

message
String

The message format to display when the assertion fails.

minValueExpression
String

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

maxValueExpression
String

The syntactic expression of maxValue 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.

Applies to