Back to Nunit

InstanceOfType Constraint

docs/articles/nunit/writing-tests/constraints/InstanceOfTypeConstraint.md

latest378 B
Original Source

InstanceOfType Constraint

InstanceOfTypeConstraint tests that an object is of the type supplied or a derived type.

Constructor

csharp
InstanceOfTypeConstraint(Type)

Syntax

csharp
Is.InstanceOf(Type)
Is.InstanceOf<T>()

Examples of Use

[!code-csharpTypeConstraintExamples]