Open
Description
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 Refresh()
, Exists
yields false
. Having peaked at the code, I don't really see an easy way to solve this. My first thought is an event subscription between the FileSystem object and any MockFileInfo / MockDirectoryInfo objects created, so that when AddFile is called, it can notify them to set their dirty flags. But I'm sure that creates other issues like circular dependencies, issues during cleanup, etc.
What do you think the best solution is here?
I'm using version 17.2.3
.