< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.KafkaSecurityModeHelper
Assembly: CoreWCF.Kafka
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Kafka/src/CoreWCF/Channels/Helpers/KafkaSecurityModeHelper.cs
Line coverage
87%
Covered lines: 7
Uncovered lines: 1
Coverable lines: 8
Total lines: 23
Line coverage: 87.5%
Branch coverage
66%
Covered branches: 4
Total branches: 6
Branch coverage: 66.6%
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(...)75%4485.71%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Kafka/src/CoreWCF/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.Channels;
 5
 6internal static class KafkaSecurityModeHelper
 7{
 8    public static bool IsDefined(KafkaSecurityMode value)
 9    {
 810        return (int)value is >= (int)KafkaSecurityMode.None and <= (int)KafkaSecurityMode.Message;
 11    }
 12
 13    public static bool IsSupported(KafkaSecurityMode value)
 14    {
 6015        return value switch
 6016        {
 617            KafkaSecurityMode.Transport => true,
 218            KafkaSecurityMode.TransportCredentialOnly => true,
 5219            KafkaSecurityMode.None => true,
 020            _ => false,
 6021        };
 22    }
 23}