< Summary

Class:Azure.ResourceManager.Compute.Models.UpgradeModeExtensions
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\UpgradeMode.Serialization.cs
Covered lines:7
Uncovered lines:4
Coverable lines:11
Total lines:30
Line coverage:63.6% (7 of 11)
Covered branches:5
Total branches:10
Branch coverage:50% (5 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-71.43%50%
ToUpgradeMode(...)-50%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\UpgradeMode.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.Compute.Models
 11{
 12    internal static class UpgradeModeExtensions
 13    {
 36414        public static string ToSerialString(this UpgradeMode value) => value switch
 36415        {
 70416            UpgradeMode.Automatic => "Automatic",
 38817            UpgradeMode.Manual => "Manual",
 018            UpgradeMode.Rolling => "Rolling",
 019            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UpgradeMode value.")
 36420        };
 21
 22        public static UpgradeMode ToUpgradeMode(this string value)
 23        {
 87224            if (string.Equals(value, "Automatic", StringComparison.InvariantCultureIgnoreCase)) return UpgradeMode.Autom
 4825            if (string.Equals(value, "Manual", StringComparison.InvariantCultureIgnoreCase)) return UpgradeMode.Manual;
 026            if (string.Equals(value, "Rolling", StringComparison.InvariantCultureIgnoreCase)) return UpgradeMode.Rolling
 027            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UpgradeMode value.");
 28        }
 29    }
 30}