< Summary

Class:Azure.ResourceManager.EventHubs.Models.EntityStatusExtensions
Assembly:Azure.ResourceManager.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\EntityStatus.Serialization.cs
Covered lines:5
Uncovered lines:18
Coverable lines:23
Total lines:42
Line coverage:21.7% (5 of 23)
Covered branches:2
Total branches:28
Branch coverage:7.1% (2 of 28)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-30.77%10%
ToEntityStatus(...)-10%5.56%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\EntityStatus.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 EntityStatusExtensions
 13    {
 814        public static string ToSerialString(this EntityStatus value) => value switch
 815        {
 1616            EntityStatus.Active => "Active",
 017            EntityStatus.Disabled => "Disabled",
 018            EntityStatus.Restoring => "Restoring",
 019            EntityStatus.SendDisabled => "SendDisabled",
 020            EntityStatus.ReceiveDisabled => "ReceiveDisabled",
 021            EntityStatus.Creating => "Creating",
 022            EntityStatus.Deleting => "Deleting",
 023            EntityStatus.Renaming => "Renaming",
 024            EntityStatus.Unknown => "Unknown",
 025            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown EntityStatus value.")
 826        };
 27
 28        public static EntityStatus ToEntityStatus(this string value)
 29        {
 30430            if (string.Equals(value, "Active", StringComparison.InvariantCultureIgnoreCase)) return EntityStatus.Active;
 031            if (string.Equals(value, "Disabled", StringComparison.InvariantCultureIgnoreCase)) return EntityStatus.Disab
 032            if (string.Equals(value, "Restoring", StringComparison.InvariantCultureIgnoreCase)) return EntityStatus.Rest
 033            if (string.Equals(value, "SendDisabled", StringComparison.InvariantCultureIgnoreCase)) return EntityStatus.S
 034            if (string.Equals(value, "ReceiveDisabled", StringComparison.InvariantCultureIgnoreCase)) return EntityStatu
 035            if (string.Equals(value, "Creating", StringComparison.InvariantCultureIgnoreCase)) return EntityStatus.Creat
 036            if (string.Equals(value, "Deleting", StringComparison.InvariantCultureIgnoreCase)) return EntityStatus.Delet
 037            if (string.Equals(value, "Renaming", StringComparison.InvariantCultureIgnoreCase)) return EntityStatus.Renam
 038            if (string.Equals(value, "Unknown", StringComparison.InvariantCultureIgnoreCase)) return EntityStatus.Unknow
 039            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown EntityStatus value.");
 40        }
 41    }
 42}