Skip to content

MockFileSystem.File.Create(string) returns a stream with CanRead false #801

@pianomanjh

Description

@pianomanjh

MockFileStream, when returned as a result of a MockFileSystem.File.Create(string path) call, incorrectly has CanRead set to false.
This is different than System.IO.File.Create(string path), which correctly sets CanRead to true.

CanRead being false, can result in problems when used with code that expects true, for example, new BinaryReader(Stream stream), which checks the CanRead property in it's ctor, and throws when not true.

Metadata

Metadata

Assignees

No one assigned

    Labels

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