Skip to content

MockFileSystem sets current directory to actual FS #350

@dzarda

Description

@dzarda

It appears that the MockFileSystem constructor calls real filesystem API when the currentDirectory parameter is left empty.

The current directory is then set as C:\Users\...\AppData\Local\Temp

I suspect the following code

    public MockFileSystem(IDictionary<string, MockFileData> files, string currentDirectory = "")
    {
        if (string.IsNullOrEmpty(currentDirectory))
        {
            currentDirectory = IO.Path.GetTempPath();
        }
        ...

in https://github.com/System-IO-Abstractions/System.IO.Abstractions/blob/4b8ff76fb410e15d26ab2cab807117323de08299/System.IO.Abstractions.TestingHelpers/MockFileSystem.cs#L22

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: in workIssues that are currently worked ontype: enhancementIssues that propose new functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions