Search Results for

    Show / Hide Table of Contents

    Class CollectionOrderedConstraint

    CollectionOrderedConstraint is used to test whether a collection is ordered.

    Inheritance
    object
    Constraint
    CollectionConstraint
    CollectionOrderedConstraint
    Implements
    IConstraint
    IResolveConstraint
    Inherited Members
    CollectionConstraint.IsEmpty(IEnumerable)
    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.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 CollectionOrderedConstraint : CollectionConstraint, IConstraint, IResolveConstraint

    Constructors

    View Source

    CollectionOrderedConstraint()

    Construct a CollectionOrderedConstraint

    Declaration
    public CollectionOrderedConstraint()

    Properties

    View Source

    Ascending

    If used performs a default ascending comparison

    Declaration
    public CollectionOrderedConstraint Ascending { get; }
    Property Value
    Type Description
    CollectionOrderedConstraint
    View Source

    Descending

    If used performs a reverse comparison

    Declaration
    public CollectionOrderedConstraint Descending { get; }
    Property Value
    Type Description
    CollectionOrderedConstraint
    View Source

    Description

    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
    Constraint.Description
    View Source

    DisplayName

    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
    Constraint.DisplayName
    View Source

    Then

    Then signals a break between two ordering steps

    Declaration
    public CollectionOrderedConstraint Then { get; }
    Property Value
    Type Description
    CollectionOrderedConstraint

    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

    True for success, false for failure

    Type Parameters
    Name Description
    TActual
    Overrides
    CollectionConstraint.ApplyTo<TActual>(TActual)
    View Source

    By(string)

    Modifies the constraint to test ordering by the value of a specified property and returns self.

    Declaration
    public CollectionOrderedConstraint By(string propertyName)
    Parameters
    Type Name Description
    string propertyName
    Returns
    Type Description
    CollectionOrderedConstraint
    View Source

    GetStringRepresentation()

    Returns the string representation of the constraint.

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

    Matches(IEnumerable)

    Test whether the collection is ordered

    Declaration
    protected override bool Matches(IEnumerable actual)
    Parameters
    Type Name Description
    IEnumerable actual
    Returns
    Type Description
    bool
    Overrides
    CollectionConstraint.Matches(IEnumerable)
    View Source

    Using(IComparer)

    Modifies the constraint to use an IComparer and returns self.

    Declaration
    public CollectionOrderedConstraint Using(IComparer comparer)
    Parameters
    Type Name Description
    IComparer comparer
    Returns
    Type Description
    CollectionOrderedConstraint
    View Source

    Using<T>(IComparer<T>)

    Modifies the constraint to use an IComparer<T> and returns self.

    Declaration
    public CollectionOrderedConstraint Using<T>(IComparer<T> comparer)
    Parameters
    Type Name Description
    IComparer<T> comparer
    Returns
    Type Description
    CollectionOrderedConstraint
    Type Parameters
    Name Description
    T
    View Source

    Using<T>(Comparison<T>)

    Modifies the constraint to use a Comparison<T> and returns self.

    Declaration
    public CollectionOrderedConstraint Using<T>(Comparison<T> comparer)
    Parameters
    Type Name Description
    Comparison<T> comparer
    Returns
    Type Description
    CollectionOrderedConstraint
    Type Parameters
    Name Description
    T

    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