Skip to content

Commit

Permalink
docs: update README.md (#43)
Browse files Browse the repository at this point in the history
Add `Getting Started` and `Examples` section
  • Loading branch information
vbreuss authored Sep 1, 2023
1 parent bd22c57 commit 93fa106
Showing 1 changed file with 32 additions and 1 deletion.
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%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");
```

0 comments on commit 93fa106

Please sign in to comment.