Table of Contents

Method ThrowIfNotPositive

Namespace
Gamelogic.Extensions
Assembly
Gamelogic.Extensions.dll

ThrowIfNotPositive(int, string)

Throws an ArgumentOutOfRangeException if the integer is not positive (i.e. zero or negative).

[AssertionMethod]
public static void ThrowIfNotPositive(this int argument, string argName = null)

Parameters

argument int

The integer to check.

argName string

The name of the argument.

Exceptions

ArgumentOutOfRangeException

argument is zero or negative.