< Summary

Class:Azure.ResourceManager.Storage.Models.KeyPermissionExtensions
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\KeyPermission.Serialization.cs
Covered lines:1
Uncovered lines:8
Coverable lines:9
Total lines:28
Line coverage:11.1% (1 of 9)
Covered branches:2
Total branches:8
Branch coverage:25% (2 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-0%0%
ToKeyPermission(...)-33.33%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\KeyPermission.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.Storage.Models
 11{
 12    internal static class KeyPermissionExtensions
 13    {
 014        public static string ToSerialString(this KeyPermission value) => value switch
 015        {
 016            KeyPermission.Read => "Read",
 017            KeyPermission.Full => "Full",
 018            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown KeyPermission value.")
 019        };
 20
 21        public static KeyPermission ToKeyPermission(this string value)
 22        {
 023            if (string.Equals(value, "Read", StringComparison.InvariantCultureIgnoreCase)) return KeyPermission.Read;
 4824            if (string.Equals(value, "Full", StringComparison.InvariantCultureIgnoreCase)) return KeyPermission.Full;
 025            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown KeyPermission value.");
 26        }
 27    }
 28}