Skip to content

FileOrDirectoryExistsConstraint

jnm2 edited this page Jun 14, 2017 · 4 revisions

FileOrDirectoryExistsConstraint tests that a File or Directory exists.

Constructor

FileOrDirectoryExistsConstraint()

Syntax

Does.Exist
Does.Not.Exist

Modifiers

IgnoreDirectories
IgnoreFiles

Examples of Use

Assert.That(fileStr, Does.Exist);
Assert.That(dirStr, Does.Exist);
Assert.That(fileStr, Does.Not.Exist);
Assert.That(dirStr, Does.Not.Exist);

Assert.That(new FileInfo(fileStr), Does.Exist);
Assert.That(new DirectoryInfo(dirStr), Does.Exist);

Clone this wiki locally