private bool VerifyContentWrittenToFile(Pip pip, PipGraph graph)
        {
            var success           = true;
            var serializedPip     = DumpPipLiteAnalysisUtilities.CreateObjectForSerialization(pip, dynamicData: null, Context.PathTable, Context.StringTable, Context.SymbolTable, graph);
            var pipWrittenToFile  = File.ReadAllBytes(GetDumpFilePath(pip));
            var serializerOptions = new JsonSerializerOptions
            {
                WriteIndented = true,
#if (NET_COREAPP_50 || NET_COREAPP_60)
// .NET 5 and 6 have a different way of dealing with null values
                DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull,
#else
                IgnoreNullValues = true,
#endif
            };

            var dumpContents = JsonSerializer.SerializeToUtf8Bytes(serializedPip, serializerOptions);

            success &= pipWrittenToFile.SequenceEqual(dumpContents);

            // Verify some random data written to the file
            var dumpString = Encoding.UTF8.GetString(pipWrittenToFile);

            success &= dumpString.Contains(pip.PipId.Value.ToString(CultureInfo.InvariantCulture) + " (" + pip.PipId.Value.ToString("X16", CultureInfo.InvariantCulture) + ")");
            success &= dumpString.Contains(pip.PipType.ToString());

            return(success);
        }
        private bool VerifyContentWrittenToFile(Pip pip, PipGraph graph)
        {
            var success           = true;
            var serializedPip     = DumpPipLiteAnalysisUtilities.CreateObjectForSerialization(pip, Context.PathTable, Context.StringTable, Context.SymbolTable, graph);
            var pipWrittenToFile  = File.ReadAllBytes(GetDumpFilePath(pip));
            var serializerOptions = new JsonSerializerOptions
            {
                WriteIndented    = true,
                IgnoreNullValues = true
            };

            var dumpContents = JsonSerializer.SerializeToUtf8Bytes(serializedPip, serializerOptions);

            success &= pipWrittenToFile.SequenceEqual(dumpContents);

            // Verify some random data written to the file
            var dumpString = Encoding.UTF8.GetString(pipWrittenToFile);

            success &= dumpString.Contains(pip.PipId.Value.ToString(CultureInfo.InvariantCulture) + " (" + pip.PipId.Value.ToString("X16", CultureInfo.InvariantCulture) + ")");
            success &= dumpString.Contains(pip.PipType.ToString());

            return(success);
        }