< Summary

Class:Azure.ResourceManager.Resources.Models.SpendingLimitExtensions
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\SpendingLimit.Serialization.cs
Covered lines:1
Uncovered lines:10
Coverable lines:11
Total lines:30
Line coverage:9% (1 of 11)
Covered branches:1
Total branches:10
Branch coverage:10% (1 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-0%0%
ToSpendingLimit(...)-25%16.67%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\SpendingLimit.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.Resources.Models
 11{
 12    internal static class SpendingLimitExtensions
 13    {
 014        public static string ToSerialString(this SpendingLimit value) => value switch
 015        {
 016            SpendingLimit.On => "On",
 017            SpendingLimit.Off => "Off",
 018            SpendingLimit.CurrentPeriodOff => "CurrentPeriodOff",
 019            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SpendingLimit value.")
 020        };
 21
 22        public static SpendingLimit ToSpendingLimit(this string value)
 23        {
 1624            if (string.Equals(value, "On", StringComparison.InvariantCultureIgnoreCase)) return SpendingLimit.On;
 025            if (string.Equals(value, "Off", StringComparison.InvariantCultureIgnoreCase)) return SpendingLimit.Off;
 026            if (string.Equals(value, "CurrentPeriodOff", StringComparison.InvariantCultureIgnoreCase)) return SpendingLi
 027            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SpendingLimit value.");
 28        }
 29    }
 30}