< Summary

Information
Line coverage
0%
Covered lines: 0
Uncovered lines: 8
Coverable lines: 8
Total lines: 30
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)0%220%

File(s)

C:\h\w\B31A098C\w\BB5A0A33\e\runtime-utils\Runner\runtime\src\libraries\System.Text.Json\src\System\Text\Json\Serialization\Attributes\JsonNumberHandlingAttribute.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
 4namespace System.Text.Json.Serialization
 5{
 6    /// <summary>
 7    /// When placed on a type, property, or field, indicates what <see cref="JsonNumberHandling"/>
 8    /// settings should be used when serializing or deserializing numbers.
 9    /// </summary>
 10    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Property | AttributeTargets.Fiel
 11    public sealed class JsonNumberHandlingAttribute : JsonAttribute
 12    {
 13        /// <summary>
 14        /// Indicates what settings should be used when serializing or deserializing numbers.
 15        /// </summary>
 016        public JsonNumberHandling Handling { get; }
 17
 18        /// <summary>
 19        /// Initializes a new instance of <see cref="JsonNumberHandlingAttribute"/>.
 20        /// </summary>
 021        public JsonNumberHandlingAttribute(JsonNumberHandling handling)
 022        {
 023            if (!JsonSerializer.IsValidNumberHandlingValue(handling))
 024            {
 025                throw new ArgumentOutOfRangeException(nameof(handling));
 26            }
 027            Handling = handling;
 028        }
 29    }
 30}