MockFileStream unexpected behavior when used via BinaryWriter #519
Labels
area: testinghelpers
Issues that address the testing helpers
state: ready to pick
Issues that are ready for being worked on
type: bug
Issues that describe misbehaving functionality
Using the latest stable NuGet version (7.0.7)
If I initialize a BinaryWriter with a MockFileStream (obtained e.g. by using MockFileSystem.File.Create), and then manipulate it via BinaryWriter.BaseStream, I get unexpected behavior. For instance, examine the following:
Presumably this is because BinaryWriter.BaseStream calls Flush on the underlying stream before returning it, though it's not immediately clear to me why this should be a problem. Avoiding accessing
BaseStream
by calling e.g.writer.Seek
directly does avoid the problem, but the point is that MockFileStream does not replicate the behavior of a real FileStream in this regard:The text was updated successfully, but these errors were encountered: