< Summary

Class:Azure.ResourceManager.Storage.Models.PublicAccessExtensions
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\PublicAccess.Serialization.cs
Covered lines:6
Uncovered lines:5
Coverable lines:11
Total lines:30
Line coverage:54.5% (6 of 11)
Covered branches:5
Total branches:10
Branch coverage:50% (5 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-57.14%25%
ToPublicAccess(...)-50%66.67%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\PublicAccess.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 PublicAccessExtensions
 13    {
 814        public static string ToSerialString(this PublicAccess value) => value switch
 815        {
 1616            PublicAccess.Container => "Container",
 017            PublicAccess.Blob => "Blob",
 018            PublicAccess.None => "None",
 019            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PublicAccess value.")
 820        };
 21
 22        public static PublicAccess ToPublicAccess(this string value)
 23        {
 6424            if (string.Equals(value, "Container", StringComparison.InvariantCultureIgnoreCase)) return PublicAccess.Cont
 025            if (string.Equals(value, "Blob", StringComparison.InvariantCultureIgnoreCase)) return PublicAccess.Blob;
 4826            if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return PublicAccess.None;
 027            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PublicAccess value.");
 28        }
 29    }
 30}