< Summary

Class:Azure.ResourceManager.Compute.Models.OperatingSystemTypesExtensions
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\OperatingSystemTypes.Serialization.cs
Covered lines:7
Uncovered lines:2
Coverable lines:9
Total lines:28
Line coverage:77.7% (7 of 9)
Covered branches:6
Total branches:8
Branch coverage:75% (6 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-83.33%75%
ToOperatingSystemTypes(...)-66.67%75%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\OperatingSystemTypes.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 OperatingSystemTypesExtensions
 13    {
 25214        public static string ToSerialString(this OperatingSystemTypes value) => value switch
 25215        {
 31616            OperatingSystemTypes.Windows => "Windows",
 44017            OperatingSystemTypes.Linux => "Linux",
 018            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OperatingSystemTypes value.")
 25219        };
 20
 21        public static OperatingSystemTypes ToOperatingSystemTypes(this string value)
 22        {
 146023            if (string.Equals(value, "Windows", StringComparison.InvariantCultureIgnoreCase)) return OperatingSystemType
 71224            if (string.Equals(value, "Linux", StringComparison.InvariantCultureIgnoreCase)) return OperatingSystemTypes.
 025            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OperatingSystemTypes value.");
 26        }
 27    }
 28}