Class AttributeExistsConstraint
- Namespace
- NUnit.Framework.Constraints
- Assembly
- nunit.framework.dll
AttributeExistsConstraint tests for the presence of a specified attribute on a Type.
public class AttributeExistsConstraint : Constraint, IConstraint, IResolveConstraint
- Inheritance
-
AttributeExistsConstraint
- Implements
- Inherited Members
Constructors
AttributeExistsConstraint(Type)
Constructs an AttributeExistsConstraint for a specific attribute Type
public AttributeExistsConstraint(Type type)
Parameters
type
Type
Properties
Description
The Description of what this constraint tests, for use in messages and in the ConstraintResult.
public override string Description { get; }
Property Value
Methods
ApplyTo<TActual>(TActual)
Tests whether the object provides the expected attribute.
public override ConstraintResult ApplyTo<TActual>(TActual actual)
Parameters
actual
TActualA Type, MethodInfo, or other ICustomAttributeProvider
Returns
- ConstraintResult
True if the expected attribute is present, otherwise false
Type Parameters
TActual