Class PathConstraint
PathConstraint serves as the abstract base of constraints that operate on paths and provides several helper methods.
Inheritance
PathConstraint
Inherited Members
Namespace: NUnit.Framework.Constraints
Assembly: nunit.framework.dll
Syntax
public abstract class PathConstraint : StringConstraint, IConstraint, IResolveConstraint
Constructors
View SourcePathConstraint(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 SourceRespectCase
Modifies the current instance to be case-sensitive and returns it.
Declaration
public PathConstraint RespectCase { get; }
Property Value
Type | Description |
---|---|
PathConstraint |
Methods
View SourceCanonicalize(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 |
GetStringRepresentation()
Returns the string representation of this constraint
Declaration
protected override string GetStringRepresentation()
Returns
Type | Description |
---|---|
string |
Overrides
View SourceIsSubPath(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 |