Skip to content

MockFileSystem created file don't exist #822

Description

@milten89

Describe the bug
From version 16.0.8 of System.IO.Abstractions.TestingHelpers when I create new file in MockFileSystem property Exist return false.

To Reproduce

IFileSystemfileSystem=newMockFileSystem();IFileInfofileInfo=fileSystem.FileInfo.FromFileName("testFile.txt");using(Streamfs=fileInfo.Create()){fs.WriteByte(0);}Console.WriteLine($"File exist: {fileInfo.Exists}");

Version 16.0.7 return True
Version 16.0.8 return False

Expected behavior
Property Exist should return True

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: needs discussionIssues that need further discussionstate: 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