Skip to content

Commit 4af7717

Browse files
authored
docs: mention related projects (#931)
1 parent f96023a commit 4af7717

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.remarkrc.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
plugins:
2+
- remark-preset-lint-consistent
3+
- remark-preset-lint-markdown-style-guide

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
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.
99

10+
## Usage
11+
1012
```shell
1113
dotnet add package TestableIO.System.IO.Abstractions
1214
```
@@ -42,6 +44,8 @@ public class MyComponent
4244
}
4345
```
4446

47+
### Test helpers
48+
4549
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.
4650

4751
```shell
@@ -94,6 +98,8 @@ void MyFancyMethod()
9498
}
9599
```
96100

101+
### Mock support
102+
97103
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):
98104

99105
```csharp
@@ -142,3 +148,14 @@ public class SomeClassUsingFileSystemWatcher
142148
}
143149
}
144150
```
151+
152+
## Related projects
153+
154+
- [`System.IO.Abstractions.Extensions`](https://github.com/TestableIO/System.IO.Abstractions.Extensions)
155+
provides convenience functionality on top of the core abstractions.
156+
157+
- [`System.IO.Abstractions.Analyzers`](https://github.com/TestableIO/System.IO.Abstractions.Analyzers)
158+
provides Roslyn analyzers to help use abstractions over static methods.
159+
160+
- [`Testably.Abstractions`](https://github.com/Testably/Testably.Abstractions)
161+
provides alternative test helpers and additional abstractions.

0 commit comments

Comments
 (0)