public void OpenFileFail() { var mountfs = new MountFileSystem(); Assert.Throws <FileNotFoundException>(() => mountfs.OpenFile("/toto.txt", FileMode.Open, FileAccess.Read)); Assert.Throws <UnauthorizedAccessException>(() => mountfs.OpenFile("/toto.txt", FileMode.Create, FileAccess.Read)); }
public Stream OpenFile(string path) { return(_fileSystem.OpenFile(path, FileMode.Open, FileAccess.Read, FileShare.Read)); }