< Summary

Class:Azure.ResourceManager.Compute.Models.OperatingSystemStateTypesExtensions
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\OperatingSystemStateTypes.Serialization.cs
Covered lines:5
Uncovered lines:4
Coverable lines:9
Total lines:28
Line coverage:55.5% (5 of 9)
Covered branches:2
Total branches:8
Branch coverage:25% (2 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-66.67%25%
ToOperatingSystemStateTypes(...)-33.33%25%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\OperatingSystemStateTypes.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 OperatingSystemStateTypesExtensions
 13    {
 4014        public static string ToSerialString(this OperatingSystemStateTypes value) => value switch
 4015        {
 8016            OperatingSystemStateTypes.Generalized => "Generalized",
 017            OperatingSystemStateTypes.Specialized => "Specialized",
 018            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OperatingSystemStateTypes value.")
 4019        };
 20
 21        public static OperatingSystemStateTypes ToOperatingSystemStateTypes(this string value)
 22        {
 9623            if (string.Equals(value, "Generalized", StringComparison.InvariantCultureIgnoreCase)) return OperatingSystem
 024            if (string.Equals(value, "Specialized", StringComparison.InvariantCultureIgnoreCase)) return OperatingSystem
 025            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OperatingSystemStateTypes value.");
 26        }
 27    }
 28}