< Summary

Class:Azure.ResourceManager.EventHubs.Models.UnavailableReasonExtensions
Assembly:Azure.ResourceManager.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\UnavailableReason.Serialization.cs
Covered lines:1
Uncovered lines:16
Coverable lines:17
Total lines:36
Line coverage:5.8% (1 of 17)
Covered branches:1
Total branches:19
Branch coverage:5.2% (1 of 19)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-0%0%
ToUnavailableReason(...)-14.29%8.33%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\UnavailableReason.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 UnavailableReasonExtensions
 13    {
 014        public static string ToSerialString(this UnavailableReason value) => value switch
 015        {
 016            UnavailableReason.None => "None",
 017            UnavailableReason.InvalidName => "InvalidName",
 018            UnavailableReason.SubscriptionIsDisabled => "SubscriptionIsDisabled",
 019            UnavailableReason.NameInUse => "NameInUse",
 020            UnavailableReason.NameInLockdown => "NameInLockdown",
 021            UnavailableReason.TooManyNamespaceInCurrentSubscription => "TooManyNamespaceInCurrentSubscription",
 022            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UnavailableReason value.")
 023        };
 24
 25        public static UnavailableReason ToUnavailableReason(this string value)
 26        {
 3227            if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return UnavailableReason.None
 028            if (string.Equals(value, "InvalidName", StringComparison.InvariantCultureIgnoreCase)) return UnavailableReas
 029            if (string.Equals(value, "SubscriptionIsDisabled", StringComparison.InvariantCultureIgnoreCase)) return Unav
 030            if (string.Equals(value, "NameInUse", StringComparison.InvariantCultureIgnoreCase)) return UnavailableReason
 031            if (string.Equals(value, "NameInLockdown", StringComparison.InvariantCultureIgnoreCase)) return UnavailableR
 032            if (string.Equals(value, "TooManyNamespaceInCurrentSubscription", StringComparison.InvariantCultureIgnoreCas
 033            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UnavailableReason value.");
 34        }
 35    }
 36}