I am not sure if that is a bug because I don't know how much this library aims to simulate behaviours of real file system so I wanted to ask about attibutes.
In microsoft docs it is said that if file does not exist then attributes is set to (FileAttributes)(-1). FileNotFoundException or DirectoryNotFoundException can only be thrown when setting the value.
But this library is throwing FileNotFoundException on reading attributes instead of returning -1 value.
Steps to reproduce the behavior:
Mock FileSystem with TestHelpers
use fs.FileInfo.FromFileName(@"x:\not-existing\path")
I am not sure if that is a bug because I don't know how much this library aims to simulate behaviours of real file system so I wanted to ask about attibutes. In microsoft docs it is said that if file does not exist then attributes is set to
(FileAttributes)(-1)
. FileNotFoundException or DirectoryNotFoundException can only be thrown when setting the value.But this library is throwing
FileNotFoundException
on reading attributes instead of returning-1
value.Steps to reproduce the behavior:
fs.FileInfo.FromFileName(@"x:\not-existing\path")
Attributes
propertyExpected behavior Value
-1
should be returned