< Summary

Class:Azure.ResourceManager.Storage.Models.DefaultActionExtensions
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\DefaultAction.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%
ToDefaultAction(...)-66.67%75%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\DefaultAction.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 DefaultActionExtensions
 13    {
 1614        public static string ToSerialString(this DefaultAction value) => value switch
 1615        {
 2016            DefaultAction.Allow => "Allow",
 2817            DefaultAction.Deny => "Deny",
 018            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DefaultAction value.")
 1619        };
 20
 21        public static DefaultAction ToDefaultAction(this string value)
 22        {
 165223            if (string.Equals(value, "Allow", StringComparison.InvariantCultureIgnoreCase)) return DefaultAction.Allow;
 4024            if (string.Equals(value, "Deny", StringComparison.InvariantCultureIgnoreCase)) return DefaultAction.Deny;
 025            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DefaultAction value.");
 26        }
 27    }
 28}