< Summary

Class:Azure.ResourceManager.EventHubs.Models.RoleDisasterRecoveryExtensions
Assembly:Azure.ResourceManager.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\RoleDisasterRecovery.Serialization.cs
Covered lines:3
Uncovered lines:8
Coverable lines:11
Total lines:30
Line coverage:27.2% (3 of 11)
Covered branches:5
Total branches:10
Branch coverage:50% (5 of 10)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\RoleDisasterRecovery.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 RoleDisasterRecoveryExtensions
 13    {
 014        public static string ToSerialString(this RoleDisasterRecovery value) => value switch
 015        {
 016            RoleDisasterRecovery.Primary => "Primary",
 017            RoleDisasterRecovery.PrimaryNotReplicating => "PrimaryNotReplicating",
 018            RoleDisasterRecovery.Secondary => "Secondary",
 019            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown RoleDisasterRecovery value.")
 020        };
 21
 22        public static RoleDisasterRecovery ToRoleDisasterRecovery(this string value)
 23        {
 1049424            if (string.Equals(value, "Primary", StringComparison.InvariantCultureIgnoreCase)) return RoleDisasterRecover
 177225            if (string.Equals(value, "PrimaryNotReplicating", StringComparison.InvariantCultureIgnoreCase)) return RoleD
 305626            if (string.Equals(value, "Secondary", StringComparison.InvariantCultureIgnoreCase)) return RoleDisasterRecov
 027            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown RoleDisasterRecovery value.");
 28        }
 29    }
 30}