Skip to content

Latest commit

 

History

History
39 lines (32 loc) · 2.27 KB

File metadata and controls

39 lines (32 loc) · 2.27 KB

Testably.Abstractions.FluentAssertions
Nuget Build Codacy Badge Coverage Mutation testing badge

This library is an extension to FluentAssertions for the IFileSystem interface.

Getting Started

  • Install Testably.Abstractions.FluentAssertions as nuget package.

    dotnet add package Testably.Abstractions.FluentAssertions
  • Add the following using statement:

    using Testably.Abstractions.FluentAssertions;

    This brings the extension methods in the current scope.

Examples

  1. Verify, that a directory "foo" exists under the current directory in the file system:

    fileSystem.Should().HaveDirectory("foo");

    or

    IDirectoryInfo directoryInfo = fileSystem.DirectoryInfo.New(".");
    directoryInfo.Should().HaveDirectory("foo");
  2. Verify, that the file "foo.txt" has text content "bar":

    fileSystem.Should().HaveFile("foo.txt")
        .Which.HasContent("bar");