System.IO.Abstractions
System.IO.Abstractions copied to clipboard
Just like System.Web.Abstractions, but for System.IO. Yay for testable IO access!
**Describe the solution you'd like** I'd like to be able to observe common/interesting events (from a testing perspective) that happen into a `MockFileSystem`. Why? I'm creating a cache service that...
Cannot run with System.IO.Abstractions latest version **To Reproduce** Create an Azure Functions project for .NET 6. Run it. Note the runtime error: ``` [2021-11-19T02:33:26.035Z] Could not load file or assembly...
https://github.com/TestableIO/System.IO.Abstractions/blob/05486f75815bd2f22beefa48407a42cb18034a72/src/System.IO.Abstractions.TestingHelpers/MockFileStream.cs#L93-L107 If Thread1 invokes this method, but Thread2 deletes the same file while Thread1 is at line 96, then Thread1 will throw a NullReferenceException at line 107. I'm not sure...
**Is your feature request related to a problem? Please describe.** I am trying to implement a static site generator, and one of the tasks I need to do is adjust...
**Describe the bug** When performing a `File.OpenWrite()`, followed by `File.Delete()` the current implementation executes this without giving any indication anything is wrong. even if attampting to perform a `filestream.Flush()` operation...
MockDirectory.Delete recursive does not consider nested files MockFileData.AllowedFileShare property
**Describe the bug** MockDirectory.Delete recursive does not consider nested files which MockFileData.AllowedFileShare property does not allow delete operation. **To Reproduce** The following test reproduces the error: [Test] public void MockDirectory_Delete_ShouldThrowIfFileAccessShareHasNoWriteOrDeleteAccess()...
**Describe the bug** On windows, when using `MockFileSystem().Path.GetRelativePath` and the `relativeTo` path does not have a drive specified, the result is inconsistent depending on what drive you run the code...
**Describe the bug** After calling `MockFileSystem.AddFile(string, MockFileData)` using a path that includes a directory ending in a period, `MockFileSystem.Directory.Exists(string)` will return false when called against the directory containing that file...
When calling Directory.EnumerateFiles on MockFileSystem, incorrect matching occurs, that differs from the real FileSystem. Mock FileSystem ``` var results = Directory.EnumerateFiles(@"c:\jobfolder\result.rreq.001.afd", "*.rreq.*.*.*"); // results has no entries ``` Real FileSystem...
**Describe the bug** See #652 . I see more problems in the future with the following settings in: * MatchType = MatchType.Win32, * IgnoreInaccessible * ReturnSpecialDirectories * AttributesToSkip * MatchCasing...