Share via


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

Definition

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

public static void IsPositive<T>(T value, string message = "") where T : struct;
static member IsPositive : 'T * string -> unit (requires 'T : struct)
Public Shared Sub IsPositive(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 positive. The message is shown in test results.

Exceptions

Thrown if value is not positive.

Applies to