< Summary

Class:Azure.ResourceManager.EventHubs.Models.KeyTypeExtensions
Assembly:Azure.ResourceManager.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\KeyType.Serialization.cs
Covered lines:5
Uncovered lines:4
Coverable lines:9
Total lines:28
Line coverage:55.5% (5 of 9)
Covered branches:3
Total branches:8
Branch coverage:37.5% (3 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-83.33%75%
ToKeyType(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\KeyType.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9
 10namespace Azure.ResourceManager.EventHubs.Models
 11{
 12    internal static class KeyTypeExtensions
 13    {
 2414        public static string ToSerialString(this KeyType value) => value switch
 2415        {
 3616            KeyType.PrimaryKey => "PrimaryKey",
 3617            KeyType.SecondaryKey => "SecondaryKey",
 018            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown KeyType value.")
 2419        };
 20
 21        public static KeyType ToKeyType(this string value)
 22        {
 023            if (string.Equals(value, "PrimaryKey", StringComparison.InvariantCultureIgnoreCase)) return KeyType.PrimaryK
 024            if (string.Equals(value, "SecondaryKey", StringComparison.InvariantCultureIgnoreCase)) return KeyType.Second
 025            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown KeyType value.");
 26        }
 27    }
 28}

Methods/Properties

ToSerialString(...)
ToKeyType(...)