System.IO.Abstractions
System.IO.Abstractions copied to clipboard
Just like System.Web.Abstractions, but for System.IO. Yay for testable IO access!
This moves the initialization of `cachedMockFileData` to the first time that it is actually used. Apparently, this is more closely to how it works in .NET 6. Closes #899
**Describe the bug** GetDrives on mac returns a DriveInfo.Name "/:\\" -- the colon and backslashes is not expected **To Reproduce** Steps to reproduce the behavior: In latest dotnet core on...
Given a project named "Test" with a "Files" folder within it, and within that folder there are 5 files included as embeddedResources, when I call the given code, it always...
Similar to #822, except I'm not invoking `MockFileInfo.Create()`. I basically do this: ``` var fs = new MockFileSystem(); var existingFile = fs.CurrentDirectory().File("test.json"); fs.AddFile(existingFile, new MockFileData("")); existingFile.Refresh(); existingFile.Exists; ``` Without the...
In .NET 5 the behaviour of the file extension search pattern changed from .NET Framework. See [EnumerateFiles](https://learn.microsoft.com/en-us/dotnet/api/system.io.directory.enumeratefiles?view=net-6.0), specifically the table entry `book.xls, book.xlsx | *.xls | book.xls | book.xls, book.xlsx`...
**Describe the bug** If you want to test if a file handle is released correctly after calling IFileInfo.OpenRead() the test does not fail when using MockFileSystem. **To Reproduce** Steps to...
**Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd...
**Describe the bug** Possibly related to https://github.com/TestableIO/System.IO.Abstractions/issues/1138 On Windows and .Net 8, `FileSystem.File.Move` successfully renames a file if the destination has a different case than source whereas `MockFileSystem.File.Move` doesn't rename...
**Describe the bug** On Windows, `FileSystem.Directory.Move` is successful when the destination has a different case than source but `MockFileSystem.Directory.Move` throws `System.IO.IOException: Source and destination path must be different.` **To Reproduce**...
The source code below should write the values 0-9 to the console. Instead it writes the value 0 to the console ten times. The code behaves as expected when using...