< Summary

Class:Azure.ResourceManager.KeyVault.Models.CreateModeExtensions
Assembly:Azure.ResourceManager.KeyVault
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\CreateMode.Serialization.cs
Covered lines:4
Uncovered lines:5
Coverable lines:9
Total lines:28
Line coverage:44.4% (4 of 9)
Covered branches:1
Total branches:8
Branch coverage:12.5% (1 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-66.67%25%
ToCreateMode(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\CreateMode.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.KeyVault.Models
 11{
 12    internal static class CreateModeExtensions
 13    {
 814        public static string ToSerialString(this CreateMode value) => value switch
 815        {
 1616            CreateMode.Recover => "recover",
 017            CreateMode.Default => "default",
 018            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CreateMode value.")
 819        };
 20
 21        public static CreateMode ToCreateMode(this string value)
 22        {
 023            if (string.Equals(value, "recover", StringComparison.InvariantCultureIgnoreCase)) return CreateMode.Recover;
 024            if (string.Equals(value, "default", StringComparison.InvariantCultureIgnoreCase)) return CreateMode.Default;
 025            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CreateMode value.");
 26        }
 27    }
 28}