diff --git a/README.md b/README.md index 78eb99a..938c659 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,35 @@ [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Testably_Testably.Abstractions.FluentAssertions&branch=main&metric=coverage)](https://sonarcloud.io/summary/overall?id=Testably_Testably.Abstractions.FluentAssertions&branch=main) [![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FTestably%2FTestably.Abstractions.FluentAssertions%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/Testably/Testably.Abstractions.FluentAssertions/main) -This library is an extension to [FluentAssertions](https://github.com/fluentassertions/fluentassertions) for the `IFileSystem` interface from [Testably.Abstractions](https://github.com/Testably/Testably.Abstractions). +This library is an extension to [FluentAssertions](https://github.com/fluentassertions/fluentassertions) for the [`IFileSystem` interface](https://github.com/TestableIO/System.IO.Abstractions). + +## Getting Started + +- Install `Testably.Abstractions.FluentAssertions` as nuget package. + ```ps + dotnet add package Testably.Abstractions.FluentAssertions + ``` + +- Add the following `using` statement: + ```csharp + 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: + ```csharp + fileSystem.Should().HaveDirectory("foo"); + ``` + or + ```csharp + IDirectoryInfo directoryInfo = fileSystem.DirectoryInfo.New("."); + directoryInfo.Should().HaveSingleDirectory("foo"); + ``` + +3. Verify, that the file "foo.txt" has text content "bar": + ```csharp + fileSystem.Should().HaveFile("foo.txt") + .Which.HasContent("bar"); + ```