private void FullSerializeAndDeserialize()
        {
            // use the sample data to fake a project
            var srcProject = BuildSampleProject2();

            var expectedTitle = SampleRomData.GetSampleUtf8CartridgeTitle();

            srcProject.Data.SnesAddressSpace.GetAnnotationCountInAllChildren <Comment>().Should().BeGreaterThan(0);
            srcProject.Data.SnesAddressSpace.GetAnnotationCountInAllChildren <Label>().Should().BeGreaterThan(0);

            // extract the bytes that would normally be in the SMC file (they only exist in code for this sample data)
            var romFileBytes = srcProject.Data.RomByteSource.Bytes.Select(e => e?.Byte ?? 0).ToList().ToList();

            // save it to create an output byte stream, we'd normally write this to the disk
            var serializer  = new ProjectXmlSerializer();
            var outputBytes = serializer.Save(srcProject);

            // now do the reverse and load our output back as the input
            var(deserializedProject, warning) = serializer.Load(outputBytes);

            // final step, the loading process doesn't save the actual SMC file bytes, so we do it ourselves here
            deserializedProject.Project.Data.RomByteSource.SetBytesFrom(romFileBytes);

            // now we can do a full compare between the original project, and the project which has been cycled through
            // serialization and deserialization
            Assert.True(warning == "");
            Assert.True(srcProject.Equals(deserializedProject.Project));

            deserializedProject.Project.Data.SnesAddressSpace.GetAnnotationCountInAllChildren <Comment>().Should().BeGreaterThan(0);
            deserializedProject.Project.Data.SnesAddressSpace.GetAnnotationCountInAllChildren <Label>().Should().BeGreaterThan(0);

            CartNameTests.TestRomCartTitle(deserializedProject.Project, expectedTitle);
        }
    public void FullSerializeAndDeserialize()
    {
        var srcProject = sampleProjectCreator.Create() as Project;

        var expectedTitle = SnesSampleRomDataFactory.GetSampleUtf8CartridgeTitle();

        srcProject.Data.Comments.Count.Should().BeGreaterThan(0);
        srcProject.Data.Labels.Labels.Count().Should().BeGreaterThan(0);

        // extract the bytes that would normally be in the SMC file (they only exist in code for this sample data)
        var romFileBytes = srcProject.Data.GetFileBytes().ToList();

        // save it to create an output byte stream, we'd normally write this to the disk

        var outputBytes = serializer.Save(srcProject);

        // now do the reverse and load our output back as the input
        var projectOpenInfo  = serializer.Load(outputBytes);
        var deserializedRoot = projectOpenInfo.Root;
        var warning          = projectOpenInfo.OpenResult.Warning;

        // final step, the loading process doesn't save the actual SMC file bytes, so we do it ourselves here
        deserializedRoot.Project.Data.RomBytes.CopyRomDataIn(romFileBytes);

        // now we can do a full compare between the original project, and the project which has been cycled through
        // serialization and deserialization
        warning.Should().Be(null);
        deserializedRoot.Project.Data.Labels.Labels.Count().Should().Be(srcProject.Data.Labels.Labels.Count());

        void TestEquivalent(Func <Project, object> func, ProjectXmlSerializer.Root root, Project project) =>
        func(root.Project).Should().BeEquivalentTo(func(project));

        TestEquivalent(x => x.Data.RomBytes, deserializedRoot, srcProject);
        TestEquivalent(x => x.Data.Comments, deserializedRoot, srcProject);
        TestEquivalent(x => x.Data.Labels, deserializedRoot, srcProject);

        deserializedRoot.Project.Should().BeEquivalentTo(srcProject);

        deserializedRoot.Project.Data.Comments.Count.Should().BePositive();
        deserializedRoot.Project.Data.Labels.Labels.Count().Should().BePositive();

        CartNameTests.TestRomCartTitle(deserializedRoot.Project, expectedTitle);
    }