Assert.IsLessThanOrEqualTo<T>(T, T, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
.