You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments