Search Results for

    Show / Hide Table of Contents

    Class PathConstraint

    PathConstraint serves as the abstract base of constraints that operate on paths and provides several helper methods.

    Inheritance
    object
    Constraint
    StringConstraint
    PathConstraint
    SamePathConstraint
    SamePathOrUnderConstraint
    SubPathConstraint
    Implements
    IConstraint
    IResolveConstraint
    Inherited Members
    StringConstraint.expected
    StringConstraint.caseInsensitive
    StringConstraint.descriptionText
    StringConstraint.ApplyTo<TActual>(TActual)
    StringConstraint.Matches(string)
    StringConstraint.Description
    StringConstraint.IgnoreCase
    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 abstract class PathConstraint : StringConstraint, IConstraint, IResolveConstraint

    Constructors

    View Source

    PathConstraint(string)

    Construct a PathConstraint for a give expected path

    Declaration
    protected PathConstraint(string expected)
    Parameters
    Type Name Description
    string expected

    The expected path

    Properties

    View Source

    RespectCase

    Modifies the current instance to be case-sensitive and returns it.

    Declaration
    public PathConstraint RespectCase { get; }
    Property Value
    Type Description
    PathConstraint

    Methods

    View Source

    Canonicalize(string)

    Canonicalize the provided path

    Declaration
    protected string Canonicalize(string path)
    Parameters
    Type Name Description
    string path
    Returns
    Type Description
    string

    The path in standardized form

    View Source

    DetermineComparisonType()

    Determines the StringComparison value based on the caseInsensitive field. If caseInsensitive is true, it returns OrdinalIgnoreCase; otherwise, it returns Ordinal.

    Declaration
    protected StringComparison DetermineComparisonType()
    Returns
    Type Description
    StringComparison
    View Source

    GetStringRepresentation()

    Returns the string representation of this constraint

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

    IsSubPath(string, string)

    Test whether one path in canonical form is a subpath of another path

    Declaration
    protected bool IsSubPath(string path1, string path2)
    Parameters
    Type Name Description
    string path1

    The first path - supposed to be the parent path

    string path2

    The second path - supposed to be the child path

    Returns
    Type Description
    bool

    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