< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 15
Coverable lines: 15
Total lines: 27
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 6
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.cctor()0%660%

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; } =
 09            AppContext.TryGetSwitch(
 010                switchName: "System.Text.Json.Serialization.EnableSourceGenReflectionFallback",
 011                isEnabled: out bool value)
 012            ? value : false;
 13
 014        public static bool RespectNullableAnnotationsDefault { get; } =
 015            AppContext.TryGetSwitch(
 016                switchName: "System.Text.Json.Serialization.RespectNullableAnnotationsDefault",
 017                isEnabled: out bool value)
 018            ? value : false;
 19
 020        public static bool RespectRequiredConstructorParametersDefault { get; } =
 021            AppContext.TryGetSwitch(
 022                switchName: "System.Text.Json.Serialization.RespectRequiredConstructorParametersDefault",
 023                isEnabled: out bool value)
 024            ? value : false;
 25    }
 26}
 27