編輯

共用方式為


Throws Class

Definition

Helper class with properties and methods that supply constraints that operate on exceptions.

public class Throws
type Throws = class
Inheritance
Throws

Constructors

Throws()

Properties

ArgumentException

Creates a constraint specifying an expected TargetInvocationException

Exception

Creates a constraint specifying an expected exception

InnerException

Creates a constraint specifying an exception with a given InnerException

InvalidOperationException

Creates a constraint specifying an expected TargetInvocationException

Nothing

Creates a constraint specifying that no exception is thrown

TargetInvocationException

Creates a constraint specifying an expected TargetInvocationException

Methods

InstanceOf(Type)

Creates a constraint specifying the type of exception expected

InstanceOf<T>()

Creates a constraint specifying the type of exception expected

TypeOf(Type)

Creates a constraint specifying the exact type of exception expected

TypeOf<T>()

Creates a constraint specifying the exact type of exception expected

Applies to