Skip to content

MockFileSystem with currentDirectory should return only one currentDirectory #592

@LosManos

Description

@LosManos
var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>
{
    { @"myfile.txt", new MockFileData("A") },
}, @"current");

makes
fileSystem.AllFiles.Single()
return
"current\current\current\myfile.txt"
which is two too many.
I also believe there should be a prepending \.


A remedy is to prepend "current" with a slash like so"

var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>
{
    { @"myfile.txt", new MockFileData("A") },
}, @"\current");

to give the result
"\current\myfile.txt"


Although I present a work around it might be considered a but as it is imho an unexpected behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: testinghelpersIssues that address the testing helpersstate: in workIssues that are currently 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