示例#1
0
        private void CodegenEqualHelper <T>(T obj, string message = null)
        {
            var knownGood = JsonSerializer.Serialize(obj);

            var memoryStream = new MemoryStream();

            CodegenSerializer.Serialize(obj, new Utf8JsonWriter(memoryStream));
            var serializedOutput = Encoding.UTF8.GetString(memoryStream.ToArray());

            Assert.AreEqual(knownGood, serializedOutput, message);
        }
示例#2
0
 public void CodegenSerializerBench()
 {
     using var writer = new Utf8JsonWriter(Stream.Null, Options);
     CodegenSerializer.Serialize(TestObjects, writer);
 }
示例#3
0
 public void CodegenSerializerBenchLargeList()
 {
     using var writer = new Utf8JsonWriter(Stream.Null, Options);
     CodegenSerializer.Serialize(LargeList, writer);
 }