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