< Summary

Line coverage
42%
Covered lines: 3
Uncovered lines: 4
Coverable lines: 7
Total lines: 24
Line coverage: 42.8%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
Read(...)100%11100%
Write(...)100%110%
GetSchema(...)100%110%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/JsonElementConverter.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System.Text.Json.Schema;
 5using System.Text.Json.Nodes;
 6
 7namespace System.Text.Json.Serialization.Converters
 8{
 9    internal sealed class JsonElementConverter : JsonConverter<JsonElement>
 10    {
 11        public override JsonElement Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
 1212        {
 1213            return JsonElement.ParseValue(ref reader, options.AllowDuplicateProperties);
 414        }
 15
 16        public override void Write(Utf8JsonWriter writer, JsonElement value, JsonSerializerOptions options)
 017        {
 018            value.WriteTo(writer);
 019        }
 20
 021        internal override JsonSchema? GetSchema(JsonNumberHandling _) => JsonSchema.CreateTrueSchema();
 22    }
 23}
 24