-
-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
dotnet has a handle on the current working directory, this will prevent deletion of any part of it.
Since we have the current working dir in the mock, we can support at least this handle
var fileSystem = new MockFileSystem();
string path = fileSystem.Path.Combine(fileSystem.Path.GetTempPath(), "my-test");
fileSystem.Directory.CreateDirectory(path);
fileSystem.Directory.SetCurrentDirectory(path);
fileSystem.Directory.Delete(fileSystem.Directory.GetCurrentDirectory());
fileSystem.Directory.SetCurrentDirectory(fileSystem.Directory.GetCurrentDirectory());Expected:
System.IO.IOException : The process cannot access the file '\\?\<Some dir that exists>' because it is being used by another process.
Actual:
Nothing, can delete the current working dir on the mock, but not on the actual file system
Will then throw it can't find the dir on the second SetCurrentDirectory
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers