Assert.IsPositive<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 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.