< Summary

Class:Azure.ResourceManager.Compute.Models.StatusLevelTypesExtensions
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\StatusLevelTypes.Serialization.cs
Covered lines:8
Uncovered lines:3
Coverable lines:11
Total lines:30
Line coverage:72.7% (8 of 11)
Covered branches:7
Total branches:10
Branch coverage:70% (7 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-71.43%50%
ToStatusLevelTypes(...)-75%83.33%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\StatusLevelTypes.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 StatusLevelTypesExtensions
 13    {
 8014        public static string ToSerialString(this StatusLevelTypes value) => value switch
 8015        {
 14416            StatusLevelTypes.Info => "Info",
 9617            StatusLevelTypes.Warning => "Warning",
 018            StatusLevelTypes.Error => "Error",
 019            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StatusLevelTypes value.")
 8020        };
 21
 22        public static StatusLevelTypes ToStatusLevelTypes(this string value)
 23        {
 182024            if (string.Equals(value, "Info", StringComparison.InvariantCultureIgnoreCase)) return StatusLevelTypes.Info;
 27625            if (string.Equals(value, "Warning", StringComparison.InvariantCultureIgnoreCase)) return StatusLevelTypes.Wa
 826            if (string.Equals(value, "Error", StringComparison.InvariantCultureIgnoreCase)) return StatusLevelTypes.Erro
 027            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StatusLevelTypes value.");
 28        }
 29    }
 30}