public void TestBinaryLoggerRoundtrip(bool useInMemoryProject)
        {
            var binLog       = GetTestFile("1.binlog");
            var binaryLogger = new BinaryLogger();

            binaryLogger.Parameters = binLog;
            var buildSuccessful = useInMemoryProject
                ? MSBuild.BuildProjectInMemory(s_testProject, binaryLogger)
                : MSBuild.BuildProjectFromFile(s_testProject, binaryLogger);

            Assert.True(buildSuccessful);

            var build = Serialization.Read(binLog);
            var xml1  = GetTestFile("1.xml");
            var xml2  = GetTestFile("2.xml");

            Serialization.Write(build, xml1);

            Serialization.Write(build, GetTestFile("1.buildlog"));
            build = Serialization.Read(GetTestFile("1.buildlog"));

            Serialization.Write(build, xml2);

            Assert.False(Differ.AreDifferent(xml1, xml2));

            build = XlinqLogReader.ReadFromXml(xml1);
            Serialization.Write(build, GetTestFile("3.xml"));
            Assert.False(Differ.AreDifferent(xml1, GetTestFile("3.xml")));

            build = Serialization.Read(xml1);
            Serialization.Write(build, GetTestFile("4.xml"));

            Assert.False(Differ.AreDifferent(xml1, GetTestFile("4.xml")));
        }