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

NUnit.Framework.Throws

public abstract class Throws
public static ExactTypeConstraint ArgumentException { get; }

public static ThrowsNothingConstraint Nothing { get; }

protected Throws()

public static InstanceOfTypeConstraint InstanceOf(Type expectedType)

public static InstanceOfTypeConstraint InstanceOf<TExpected>() where TExpected : Exception

Creates a constraint specifying the type of exception expected

public static ExactTypeConstraint TypeOf(Type expectedType)

Creates a constraint specifying the exact type of exception expected

public static ExactTypeConstraint TypeOf<TExpected>() where TExpected : Exception

Creates a constraint specifying the exact type of exception expected