Class ExactTypeConstraint
ExactTypeConstraint is used to test that an object is of the exact type provided in the constructor
Inherited Members
Namespace: NUnit.Framework.Constraints
Assembly: nunit.framework.dll
Syntax
public class ExactTypeConstraint : TypeConstraint, IConstraint, IResolveConstraint
Constructors
View SourceExactTypeConstraint(Type)
Construct an ExactTypeConstraint for a given Type
Declaration
public ExactTypeConstraint(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The expected Type. |
Properties
View SourceDisplayName
The display name of this Constraint for use by ToString(). The default value is the name of the constraint with trailing "Constraint" removed. Derived classes may set this to another name in their constructors.
Declaration
public override string DisplayName { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
Methods
View SourceMatches(object?)
Apply the constraint to an actual value, returning true if it succeeds
Declaration
protected override bool Matches(object? actual)
Parameters
Type | Name | Description |
---|---|---|
object | actual | The actual argument |
Returns
Type | Description |
---|---|
bool | True if the constraint succeeds, otherwise false. |