<PackageReference Include="NUnit" Version="2.6.1" />

PathConstraint

public abstract class PathConstraint : Constraint
PathConstraint serves as the abstract base of constraints that operate on paths and provides several helper methods.
protected string actualPath

The actual path being tested

protected bool caseInsensitive

Flag indicating whether a caseInsensitive comparison should be made

protected string expectedPath

The expected path used in the constraint

public PathConstraint IgnoreCase { get; }

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

public PathConstraint RespectCase { get; }

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

protected PathConstraint(string expected)

Construct a PathConstraint for a give expected path

protected static string Canonicalize(string path)

Canonicalize the provided path

protected static bool IsSamePath(string path1, string path2, bool ignoreCase)

Test whether two paths are the same

protected static bool IsSubPath(string path1, string path2, bool ignoreCase)

Test whether one path is under another path

protected abstract bool IsMatch(string expectedPath, string actualPath)

Returns true if the expected path and actual path match

protected bool IsSamePathOrUnder(string path1, string path2)

Test whether one path is the same as or under another path