System.IO.Abstractions icon indicating copy to clipboard operation
System.IO.Abstractions copied to clipboard

MockFileSystem does not fail on File.Create when directory does not exists.

Open kaar opened this issue 9 years ago • 1 comments

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 avatar May 26 '17 13:05 kaar

@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");
        }

jpreese avatar Jul 07 '18 03:07 jpreese