< Summary

Class:Azure.ResourceManager.Storage.Models.StateExtensions
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\State.Serialization.cs
Covered lines:1
Uncovered lines:14
Coverable lines:15
Total lines:34
Line coverage:6.6% (1 of 15)
Covered branches:3
Total branches:16
Branch coverage:18.7% (3 of 16)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-0%0%
ToState(...)-16.67%30%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\State.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 StateExtensions
 13    {
 014        public static string ToSerialString(this State value) => value switch
 015        {
 016            State.Provisioning => "provisioning",
 017            State.Deprovisioning => "deprovisioning",
 018            State.Succeeded => "succeeded",
 019            State.Failed => "failed",
 020            State.NetworkSourceDeleted => "networkSourceDeleted",
 021            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown State value.")
 022        };
 23
 24        public static State ToState(this string value)
 25        {
 026            if (string.Equals(value, "provisioning", StringComparison.InvariantCultureIgnoreCase)) return State.Provisio
 027            if (string.Equals(value, "deprovisioning", StringComparison.InvariantCultureIgnoreCase)) return State.Deprov
 3228            if (string.Equals(value, "succeeded", StringComparison.InvariantCultureIgnoreCase)) return State.Succeeded;
 029            if (string.Equals(value, "failed", StringComparison.InvariantCultureIgnoreCase)) return State.Failed;
 030            if (string.Equals(value, "networkSourceDeleted", StringComparison.InvariantCultureIgnoreCase)) return State.
 031            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown State value.");
 32        }
 33    }
 34}

Methods/Properties

ToSerialString(...)
ToState(...)