Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update README.md #43

Merged
merged 2 commits into from
Sep 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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%2Fgit.luolix.top%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");
```
Loading