Share via


Assert.IsNegative<T>(T, String) Method

Definition

Tests whether the specified value is negative and throws an exception if it is not.

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

Type Parameters

T

The type of value to test.

Parameters

value
T

The value to test.

message
String

The message to include in the exception when value is not negative. The message is shown in test results.

Exceptions

Thrown if value is not negative.

Applies to