< Summary

Class:Azure.ResourceManager.Resources.Models.ChangeTypeExtensions
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ChangeType.Serialization.cs
Covered lines:6
Uncovered lines:11
Coverable lines:17
Total lines:36
Line coverage:35.2% (6 of 17)
Covered branches:11
Total branches:19
Branch coverage:57.8% (11 of 19)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-0%0%
ToChangeType(...)-85.71%91.67%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ChangeType.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 ChangeTypeExtensions
 13    {
 014        public static string ToSerialString(this ChangeType value) => value switch
 015        {
 016            ChangeType.Create => "Create",
 017            ChangeType.Delete => "Delete",
 018            ChangeType.Ignore => "Ignore",
 019            ChangeType.Deploy => "Deploy",
 020            ChangeType.NoChange => "NoChange",
 021            ChangeType.Modify => "Modify",
 022            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ChangeType value.")
 023        };
 24
 25        public static ChangeType ToChangeType(this string value)
 26        {
 9027            if (string.Equals(value, "Create", StringComparison.InvariantCultureIgnoreCase)) return ChangeType.Create;
 4228            if (string.Equals(value, "Delete", StringComparison.InvariantCultureIgnoreCase)) return ChangeType.Delete;
 4229            if (string.Equals(value, "Ignore", StringComparison.InvariantCultureIgnoreCase)) return ChangeType.Ignore;
 3230            if (string.Equals(value, "Deploy", StringComparison.InvariantCultureIgnoreCase)) return ChangeType.Deploy;
 2431            if (string.Equals(value, "NoChange", StringComparison.InvariantCultureIgnoreCase)) return ChangeType.NoChang
 3232            if (string.Equals(value, "Modify", StringComparison.InvariantCultureIgnoreCase)) return ChangeType.Modify;
 033            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ChangeType value.");
 34        }
 35    }
 36}