< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.ServiceModel.Channels.KafkaSecurityModeHelper
Assembly: CoreWCF.Kafka.Client
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Kafka.Client/src/CoreWCF/ServiceModel/Channels/Helpers/KafkaSecurityModeHelper.cs
Line coverage
75%
Covered lines: 6
Uncovered lines: 2
Coverable lines: 8
Total lines: 23
Line coverage: 75%
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
IsDefined(...)50%22100%
IsSupported(...)50%4471.42%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Kafka.Client/src/CoreWCF/ServiceModel/Channels/Helpers/KafkaSecurityModeHelper.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 CoreWCF.ServiceModel.Channels;
 5
 6internal static class KafkaSecurityModeHelper
 7{
 8    public static bool IsDefined(KafkaSecurityMode value)
 9    {
 510        return (int)value is >= (int)KafkaSecurityMode.None and <= (int)KafkaSecurityMode.Message;
 11    }
 12
 13    public static bool IsSupported(KafkaSecurityMode value)
 14    {
 515        return value switch
 516        {
 417            KafkaSecurityMode.Transport => true,
 118            KafkaSecurityMode.TransportCredentialOnly => true,
 019            KafkaSecurityMode.None => true,
 020            _ => false,
 521        };
 22    }
 23}