Skip to content

Bug: Filesystem serialization & deserialization works with fileSystem.GetFile(path).Contents) but not fileSystem.File.ReadAllBytes(path)); #520

@darl2ng

Description

@darl2ng

For now directories and files are restored but reading file content raises null exception:

// save:
IFormatter formatter = new BinaryFormatter();
            Stream stream = new FileStream(Path.GetTempPath() + "test.io", FileMode.Create, FileAccess.Write);
            formatter.Serialize(stream, fileSystem);
            stream.Close();

// reload
IFormatter formatter = new BinaryFormatter();
            Stream stream = new FileStream(Path.GetTempPath() + FS_FILENAME, FileMode.Open, FileAccess.Read);
            IFileSystem fileSystem = (MockFileSystem)formatter.Deserialize(stream);
            stream.Close();
            return fileSystem;

// read
fileSystem.File.ReadAllBytes(fileInfo.FullName); // => exception

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: testinghelpersIssues that address the testing helpersstate: ready to pickIssues that are ready for being 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