Class Throws
Helper class with properties and methods that supply constraints that operate on exceptions.
public class Throws
- Inheritance
-
Throws
- Inherited Members
Constructors
Throws()
public Throws()
Properties
ArgumentException
Creates a constraint specifying an expected TargetInvocationException
public static ExactTypeConstraint ArgumentException { get; }
Property Value
Exception
Creates a constraint specifying an expected exception
public static ResolvableConstraintExpression Exception { get; }
Property Value
InnerException
Creates a constraint specifying an exception with a given InnerException
public static ResolvableConstraintExpression InnerException { get; }
Property Value
InvalidOperationException
Creates a constraint specifying an expected TargetInvocationException
public static ExactTypeConstraint InvalidOperationException { get; }
Property Value
Nothing
Creates a constraint specifying that no exception is thrown
public static ThrowsNothingConstraint Nothing { get; }
Property Value
TargetInvocationException
Creates a constraint specifying an expected TargetInvocationException
public static ExactTypeConstraint TargetInvocationException { get; }
Property Value
Methods
InstanceOf(Type)
Creates a constraint specifying the type of exception expected
public static InstanceOfTypeConstraint InstanceOf(Type expectedType)
Parameters
expectedType
Type
Returns
InstanceOf<TExpected>()
Creates a constraint specifying the type of exception expected
public static InstanceOfTypeConstraint InstanceOf<TExpected>()
Returns
Type Parameters
TExpected
TypeOf(Type)
Creates a constraint specifying the exact type of exception expected
public static ExactTypeConstraint TypeOf(Type expectedType)
Parameters
expectedType
Type
Returns
TypeOf<TExpected>()
Creates a constraint specifying the exact type of exception expected
public static ExactTypeConstraint TypeOf<TExpected>()
Returns
Type Parameters
TExpected