< Summary

Line coverage
93%
Covered lines: 14
Uncovered lines: 1
Coverable lines: 15
Total lines: 27
Line coverage: 93.3%
Branch coverage
50%
Covered branches: 3
Total branches: 6
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.cctor()50%66100%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Text.Json/src/System/Text/Json/AppContextSwitchHelper.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
 5{
 6    internal static class AppContextSwitchHelper
 7    {
 08        public static bool IsSourceGenReflectionFallbackEnabled { get; } =
 19            AppContext.TryGetSwitch(
 110                switchName: "System.Text.Json.Serialization.EnableSourceGenReflectionFallback",
 111                isEnabled: out bool value)
 112            ? value : false;
 13
 28314        public static bool RespectNullableAnnotationsDefault { get; } =
 115            AppContext.TryGetSwitch(
 116                switchName: "System.Text.Json.Serialization.RespectNullableAnnotationsDefault",
 117                isEnabled: out bool value)
 118            ? value : false;
 19
 28320        public static bool RespectRequiredConstructorParametersDefault { get; } =
 121            AppContext.TryGetSwitch(
 122                switchName: "System.Text.Json.Serialization.RespectRequiredConstructorParametersDefault",
 123                isEnabled: out bool value)
 124            ? value : false;
 25    }
 26}
 27