Search Results for

    Show / Hide Table of Contents

    Class PropertyConstraint

    PropertyConstraint extracts a named property and uses its value as the actual value for a chained constraint.

    Inheritance
    object
    Constraint
    PrefixConstraint
    PropertyConstraint
    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 PropertyConstraint : PrefixConstraint, IConstraint, IResolveConstraint

    Constructors

    View Source

    PropertyConstraint(string, IConstraint)

    Initializes a new instance of the PropertyConstraint class.

    Declaration
    public PropertyConstraint(string name, IConstraint baseConstraint)
    Parameters
    Type Name Description
    string name

    The name.

    IConstraint baseConstraint

    The constraint to apply to the property.

    Methods

    View Source

    ApplyTo<TActual>(TActual)

    Test whether the constraint is satisfied by a given value

    Declaration
    public override ConstraintResult ApplyTo<TActual>(TActual actual)
    Parameters
    Type Name Description
    TActual actual

    The value to be tested

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

    GetStringRepresentation()

    Returns the 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