Skip to content

Commit dc1982b

Browse files
committed
Update description in Readme
1 parent 3836c6b commit dc1982b

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,37 @@ Abstraction for the .Net Filesystem classes
44
[![Build status](https://img.shields.io/appveyor/build/chriswalpen/Abstract.FileSystem/master?label=Master&logo=appveyor&style=for-the-badge)](https://ci.appveyor.com/project/chriswalpen/Abstract.FileSystem/branch/master)
55
[![Build status](https://img.shields.io/appveyor/build/chriswalpen/Abstract.FileSystem/dev?label=Dev&logo=appveyor&style=for-the-badge)](https://ci.appveyor.com/project/chriswalpen/Abstract.FileSystem/branch/dev)
66

7+
8+
Wrappers for some common classes from System.IO Namespace to create a layer of abstraction
9+
10+
Current implementaitons of System.IO
11+
* Directory
12+
* File
13+
14+
## Usage in code
15+
Instead of using the Namespace System.IO include the Namespace Abstract.FileSystem to use Directory or File.
16+
17+
## Usage in Tests
18+
Abstract.FileSystem.Directory and Abstract.FileSystem.File both have a Factory Property. This can be set through the static method Setup(Func<IFileService> service) or Setup(Func<IDirectoryService> service).
19+
The Interface IFileService and IDirectoryService both provide the abstraction layers.
20+
21+
```
22+
_service = new Mock<IDirectoryService>();
23+
Directory.Setup(() => _service.Object);
24+
```
25+
Now all Access to Abstract.FileSystem.Directory use the Mock of IDirectoryServerice
26+
27+
# SystemPath
28+
Path behaviour on Linux differs from Windows. For this reason there is a class for SystemPath that manages paths depending on the system that is run on.
29+
```
30+
var path = (SystemPath)"Test" / "Path";
31+
path.ToString();
32+
```
33+
On a Windows this results in
34+
```
35+
Test\Path
36+
```
37+
while on a Unix system the result looks different
38+
```
39+
Test/Path
40+
```

0 commit comments

Comments
 (0)