Table of Contents

Class PathConstraint

Namespace
NUnit.Framework.Constraints
Assembly
nunit.framework.dll

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

public abstract class PathConstraint : StringConstraint, IConstraint, IResolveConstraint
Inheritance
PathConstraint
Implements
Derived
Inherited Members

Constructors

PathConstraint(string)

Construct a PathConstraint for a give expected path

protected PathConstraint(string expected)

Parameters

expected string

The expected path

Properties

RespectCase

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

public PathConstraint RespectCase { get; }

Property Value

PathConstraint

Methods

Canonicalize(string)

Canonicalize the provided path

protected string Canonicalize(string path)

Parameters

path string

Returns

string

The path in standardized form

GetStringRepresentation()

Returns the string representation of this constraint

protected override string GetStringRepresentation()

Returns

string

IsSubPath(string, string)

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

protected bool IsSubPath(string path1, string path2)

Parameters

path1 string

The first path - supposed to be the parent path

path2 string

The second path - supposed to be the child path

Returns

bool