< Summary

Information
Line coverage
93%
Covered lines: 14
Uncovered lines: 1
Coverable lines: 15
Total lines: 26
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)

C:\h\w\B31A098C\w\BB5A0A33\e\runtime-utils\Runner\runtime\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
 68214        public static bool RespectNullableAnnotationsDefault { get; } =
 115            AppContext.TryGetSwitch(
 116                switchName: "System.Text.Json.Serialization.RespectNullableAnnotationsDefault",
 117                isEnabled: out bool value)
 118            ? value : false;
 19
 68220        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}