C# Class UnityEngine.NUnit.Framework.Constraints.PathConstraint

PathConstraint serves as the abstract base of constraints that operate on paths and provides several helper methods.
Inheritance: Constraint
Mostrar archivo Open project: Unity-Technologies/nunitv2

Protected Properties

Property Type Description
caseInsensitive bool
expectedPath string

Public Methods

Method Description
Matches ( object actual ) : bool

Test whether the constraint is satisfied by a given value

Protected Methods

Method Description
Canonicalize ( string path ) : string

Transform the provided path to its canonical form so that it may be more easily be compared with other paths.

GetStringRepresentation ( ) : string

Returns the string representation of this constraint

IsMatch ( string expectedPath, string actualPath ) : bool

Returns true if the expected path and actual path match

IsSubPath ( string path1, string path2, bool ignoreCase ) : bool

Test whether one path in canonical form is under another.

PathConstraint ( string expectedPath ) : System

Construct a PathConstraint for a give expected path

Method Details

Canonicalize() protected static method

Transform the provided path to its canonical form so that it may be more easily be compared with other paths.
protected static Canonicalize ( string path ) : string
path string The original path
return string

GetStringRepresentation() protected method

Returns the string representation of this constraint
protected GetStringRepresentation ( ) : string
return string

IsMatch() protected abstract method

Returns true if the expected path and actual path match
protected abstract IsMatch ( string expectedPath, string actualPath ) : bool
expectedPath string
actualPath string
return bool

IsSubPath() protected static method

Test whether one path in canonical form is under another.
protected static IsSubPath ( string path1, string path2, bool ignoreCase ) : bool
path1 string The first path - supposed to be the parent path
path2 string The second path - supposed to be the child path
ignoreCase bool Indicates whether case should be ignored
return bool

Matches() public method

Test whether the constraint is satisfied by a given value
public Matches ( object actual ) : bool
actual object The value to be tested
return bool

PathConstraint() protected method

Construct a PathConstraint for a give expected path
protected PathConstraint ( string expectedPath ) : System
expectedPath string The expected path
return System

Property Details

caseInsensitive protected_oe property

Flag indicating whether a caseInsensitive comparison should be made
protected bool caseInsensitive
return bool

expectedPath protected_oe property

The expected path used in the constraint
protected string expectedPath
return string