< Summary

Class:Azure.ResourceManager.Resources.Models.PropertyChangeTypeExtensions
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\PropertyChangeType.Serialization.cs
Covered lines:2
Uncovered lines:11
Coverable lines:13
Total lines:32
Line coverage:15.3% (2 of 13)
Covered branches:4
Total branches:13
Branch coverage:30.7% (4 of 13)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-0%0%
ToPropertyChangeType(...)-40%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\PropertyChangeType.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 PropertyChangeTypeExtensions
 13    {
 014        public static string ToSerialString(this PropertyChangeType value) => value switch
 015        {
 016            PropertyChangeType.Create => "Create",
 017            PropertyChangeType.Delete => "Delete",
 018            PropertyChangeType.Modify => "Modify",
 019            PropertyChangeType.Array => "Array",
 020            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PropertyChangeType value.")
 021        };
 22
 23        public static PropertyChangeType ToPropertyChangeType(this string value)
 24        {
 3225            if (string.Equals(value, "Create", StringComparison.InvariantCultureIgnoreCase)) return PropertyChangeType.C
 026            if (string.Equals(value, "Delete", StringComparison.InvariantCultureIgnoreCase)) return PropertyChangeType.D
 1627            if (string.Equals(value, "Modify", StringComparison.InvariantCultureIgnoreCase)) return PropertyChangeType.M
 028            if (string.Equals(value, "Array", StringComparison.InvariantCultureIgnoreCase)) return PropertyChangeType.Ar
 029            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PropertyChangeType value.");
 30        }
 31    }
 32}