Search Results for

    Show / Hide Table of Contents

    FileOrDirectoryExists Constraint

    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);
    
    • Edit this page
    In this article
    Back to top Generated by DocFX | Copyright (c) 2018- The NUnit Project - Licensed under CC BY-NC-SA 4.0