Class FileOrDirectoryExistsConstraint
FileOrDirectoryExistsConstraint is used to determine if a file or directory exists
Inherited Members
Namespace: NUnit.Framework.Constraints
Assembly: nunit.framework.dll
Syntax
public class FileOrDirectoryExistsConstraint : Constraint, IConstraint, IResolveConstraint
Constructors
View SourceFileOrDirectoryExistsConstraint()
Initializes a new instance of the FileOrDirectoryExistsConstraint class that will check files and directories.
Declaration
public FileOrDirectoryExistsConstraint()
FileOrDirectoryExistsConstraint(bool)
Initializes a new instance of the FileOrDirectoryExistsConstraint class that will only check files if ignoreDirectories is true.
Declaration
public FileOrDirectoryExistsConstraint(bool ignoreDirectories)
Parameters
Type | Name | Description |
---|---|---|
bool | ignoreDirectories | if set to true [ignore directories]. |
Properties
View SourceDescription
The Description of what this constraint tests, for use in messages and in the ConstraintResult.
Declaration
public override string Description { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
View SourceIgnoreDirectories
If true, the constraint will only check if files exist, not directories
Declaration
public FileOrDirectoryExistsConstraint IgnoreDirectories { get; }
Property Value
Type | Description |
---|---|
FileOrDirectoryExistsConstraint |
IgnoreFiles
If true, the constraint will only check if directories exist, not files
Declaration
public FileOrDirectoryExistsConstraint IgnoreFiles { get; }
Property Value
Type | Description |
---|---|
FileOrDirectoryExistsConstraint |
Methods
View SourceApplyTo<TActual>(TActual)
Applies the constraint to an actual value, returning a ConstraintResult.
Declaration
public override ConstraintResult ApplyTo<TActual>(TActual actual)
Parameters
Type | Name | Description |
---|---|---|
TActual | actual | The value to be tested |
Returns
Type | Description |
---|---|
ConstraintResult | A ConstraintResult |
Type Parameters
Name | Description |
---|---|
TActual |