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); }
public void CodegenSerializerBench() { using var writer = new Utf8JsonWriter(Stream.Null, Options); CodegenSerializer.Serialize(TestObjects, writer); }
public void CodegenSerializerBenchLargeList() { using var writer = new Utf8JsonWriter(Stream.Null, Options); CodegenSerializer.Serialize(LargeList, writer); }