Search Results for

    Show / Hide Table of Contents

    Class AttributeConstraint

    AttributeConstraint tests that a specified attribute is present on a Type or other provider and that the value of the attribute satisfies some other constraint.

    Inheritance
    object
    Constraint
    PrefixConstraint
    AttributeConstraint
    Implements
    IConstraint
    IResolveConstraint
    Inherited Members
    PrefixConstraint.BaseConstraint
    PrefixConstraint.DescriptionPrefix
    PrefixConstraint.Description
    Constraint.ApplyTo<TActual>(ActualValueDelegate<TActual>)
    Constraint.ApplyTo<TActual>(ref TActual)
    Constraint.ApplyToAsync<TActual>(Func<Task<TActual>>)
    Constraint.GetTestObject<TActual>(ActualValueDelegate<TActual>)
    Constraint.ToString()
    Constraint.GetStringRepresentation(IEnumerable)
    Constraint.After(int)
    Constraint.After(int, int)
    Constraint.DisplayName
    Constraint.Arguments
    Constraint.Builder
    Constraint.And
    Constraint.With
    Constraint.Or
    object.GetType()
    object.MemberwiseClone()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: NUnit.Framework.Constraints
    Assembly: nunit.framework.dll
    Syntax
    public class AttributeConstraint : PrefixConstraint, IConstraint, IResolveConstraint

    Constructors

    View Source

    AttributeConstraint(Type, IConstraint)

    Constructs an AttributeConstraint for a specified attribute Type and base constraint.

    Declaration
    public AttributeConstraint(Type type, IConstraint baseConstraint)
    Parameters
    Type Name Description
    Type type
    IConstraint baseConstraint

    Methods

    View Source

    ApplyTo<TActual>(TActual)

    Determines whether the Type or other provider has the expected attribute and if its value matches the additional constraint specified.

    Declaration
    public override ConstraintResult ApplyTo<TActual>(TActual actual)
    Parameters
    Type Name Description
    TActual actual
    Returns
    Type Description
    ConstraintResult
    Type Parameters
    Name Description
    TActual
    Overrides
    Constraint.ApplyTo<TActual>(TActual)
    View Source

    GetStringRepresentation()

    Returns a string representation of the constraint.

    Declaration
    protected override string GetStringRepresentation()
    Returns
    Type Description
    string
    Overrides
    Constraint.GetStringRepresentation()

    Implements

    IConstraint
    IResolveConstraint
    • View Source
    In this article
    Back to top Generated by DocFX | Copyright (c) 2018- The NUnit Project - Licensed under CC BY-NC-SA 4.0