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
stringThe expected path
Properties
RespectCase
Modifies the current instance to be case-sensitve and returns it.
public PathConstraint RespectCase { get; }
Property Value
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
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
stringThe first path - supposed to be the parent path
path2
stringThe second path - supposed to be the child path