<PackageReference Include="NUnit" Version="4.3.2" />

Guard

static class Guard
Class used to guard against unexpected argument values or operations by throwing an appropriate exception.
public static void ArgumentInRange(bool condition, string message, string paramName)

Throws an ArgumentOutOfRangeException if the specified condition is not met.

public static void ArgumentNotAsyncVoid(Delegate delegate, string paramName)

Throws an ArgumentException if the specified delegate is async void.

public static void ArgumentNotAsyncVoid(MethodInfo method, string paramName)

Throws an ArgumentException if the specified delegate is async void.

public static void ArgumentNotNull(object value, string name)

Throws an exception if an argument is null

public static void ArgumentNotNullOrEmpty(string value, string name)

Throws an exception if a string argument is null or empty

public static void ArgumentValid(bool condition, string message, string paramName)

Throws an ArgumentException if the specified condition is not met.

public static void OperationValid(bool condition, string message)

Throws an InvalidOperationException if the specified condition is not met.