Skip to content

MockFile.ReadAllText throws NullReferenceException on non existing file #758

@derpflanz

Description

@derpflanz

Describe the bug
MockFile.ReadAllText throws NullReferenceException on non existing file. I expect FileNotFoundException

To Reproduce
var fileSystem = new MockFileSystem();
fileSystem.File.ReadAllText("nonexisting file", Encoding.UTF8);
--> A NullReferenceException is thrown

Expected behavior
--> A FileNotFoundException is thrown

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: testinghelpersIssues that address the testing helpersflag: good-first-issueIssues that are good for first time contributorsstate: ready to pickIssues that are ready for being worked ontype: bugIssues that describe misbehaving functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions