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: mention related projects #931

Merged
merged 5 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions .remarkrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins:
- remark-preset-lint-consistent
- remark-preset-lint-markdown-style-guide
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

At the core of the library is `IFileSystem` and `FileSystem`. Instead of calling methods like `File.ReadAllText` directly, use `IFileSystem.File.ReadAllText`. We have exactly the same API, except that ours is injectable and testable.

## Usage

```shell
dotnet add package TestableIO.System.IO.Abstractions
```
Expand Down Expand Up @@ -42,6 +44,8 @@ public class MyComponent
}
```

### Test helpers

The library also ships with a series of test helpers to save you from having to mock out every call, for basic scenarios. They are not a complete copy of a real-life file system, but they'll get you most of the way there.

```shell
Expand Down Expand Up @@ -94,6 +98,8 @@ void MyFancyMethod()
}
```

### Mock support

Since version 4.0 the top-level APIs expose interfaces instead of abstract base classes (these still exist, though), allowing you to completely mock the file system. Here's a small example, using [Moq](https://github.com/moq/moq4):

```csharp
Expand Down Expand Up @@ -142,3 +148,14 @@ public class SomeClassUsingFileSystemWatcher
}
}
```

## Related projects

- [`System.IO.Abstractions.Extensions`](https://github.com/TestableIO/System.IO.Abstractions.Extensions)
provides convenience functionality on top of the core abstractions.

- [`System.IO.Abstractions.Analyzers`](https://github.com/TestableIO/System.IO.Abstractions.Analyzers)
provides Roslyn analyzers to help use abstractions over static methods.

- [`Testably.Abstractions`](https://github.com/Testably/Testably.Abstractions)
provides alternative test helpers and additional abstractions.