System.IO.Abstractions
System.IO.Abstractions copied to clipboard
MockFileSystem does not fail on File.Create when directory does not exists.
This should fail when directory for fileName does not exists. This is not the case when using MockFileSystem
using (var file = fileSystem.File.Create(fileName)) {
}
On a real file system this thows.
@kaar I just ran this test scenario on my local machine, and I am getting a DirectoryNotFoundException.
[Test]
public void Test()
{
var fs = new MockFileSystem();
fs.File.Create(@"C:\lol.txt");
}