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

Throws

public class Throws
Helper class with properties and methods that supply constraints that operate on exceptions.
public static ExactTypeConstraint ArgumentException { get; }

Creates a constraint specifying an expected TargetInvocationException

Creates a constraint specifying an expected exception

Creates a constraint specifying an exception with a given InnerException

Creates a constraint specifying an expected TargetInvocationException

public static ThrowsNothingConstraint Nothing { get; }

Creates a constraint specifying that no exception is thrown

Creates a constraint specifying an expected TargetInvocationException

public Throws()

public static InstanceOfTypeConstraint InstanceOf(Type expectedType)

Creates a constraint specifying the type of exception expected

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<T>()

Creates a constraint specifying the exact type of exception expected