< Summary

Class:Azure.ResourceManager.Storage.Models.ReasonExtensions
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\Reason.Serialization.cs
Covered lines:2
Uncovered lines:7
Coverable lines:9
Total lines:28
Line coverage:22.2% (2 of 9)
Covered branches:3
Total branches:8
Branch coverage:37.5% (3 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-0%0%
ToReason(...)-66.67%75%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\Reason.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 ReasonExtensions
 13    {
 014        public static string ToSerialString(this Reason value) => value switch
 015        {
 016            Reason.AccountNameInvalid => "AccountNameInvalid",
 017            Reason.AlreadyExists => "AlreadyExists",
 018            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown Reason value.")
 019        };
 20
 21        public static Reason ToReason(this string value)
 22        {
 1223            if (string.Equals(value, "AccountNameInvalid", StringComparison.InvariantCultureIgnoreCase)) return Reason.A
 824            if (string.Equals(value, "AlreadyExists", StringComparison.InvariantCultureIgnoreCase)) return Reason.Alread
 025            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown Reason value.");
 26        }
 27    }
 28}

Methods/Properties

ToSerialString(...)
ToReason(...)