Skip to content

MockFileSystem does not support Root directories #702

Description

@derecskey

Describe the bug
Including a Root drive/directory in a MockFileSystem causes ArgumentNullException at line 82 of MockFileSystem.cs

To Reproduce
To recreate, execute the following line of code:

varfileSystem=newMockFileSystem(newDictionary<string,MockFileData>{{@"c:\demo",newMockDirectoryData()},{@"z:\",newMockDirectoryData()},{@"Z:\foo",newMockDirectoryData()}});

Expected behavior

"Z:" should be a valid directory.

Additional context

varfileSystem=newMockFileSystem(newDictionary<string,MockFileData>{{@"c:\demo",newMockDirectoryData()},//{ @"z:\", new MockDirectoryData() },{@"Z:\foo",newMockDirectoryData()}});//This produces no exceptionvarfileSystem=newMockFileSystem(newDictionary<string,MockFileData>{{@"c:\demo",newMockDirectoryData()},//{ @"z:\", new MockDirectoryData() },{@"Z:\foo",newMockDirectoryData()}});//This produces an exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: testinghelpersIssues that address the testing helpersstate: ready to pickIssues that are ready for being worked onstate: releasedIssues that are releasedtype: 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