< Summary

Information
Line coverage
42%
Covered lines: 3
Uncovered lines: 4
Coverable lines: 7
Total lines: 23
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)

C:\h\w\B31A098C\w\BB5A0A33\e\runtime-utils\Runner\runtime\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)
 63412        {
 63413            return JsonElement.ParseValue(ref reader, options.AllowDuplicateProperties);
 42814        }
 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}