< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-50%20%
ToResourceIdentityType(...)-20%12.5%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ResourceIdentityType.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 ResourceIdentityTypeExtensions
 13    {
 1614        public static string ToSerialString(this ResourceIdentityType value) => value switch
 1615        {
 3216            ResourceIdentityType.SystemAssigned => "SystemAssigned",
 017            ResourceIdentityType.None => "None",
 018            ResourceIdentityType.UserAssigned => "UserAssigned",
 019            ResourceIdentityType.SystemAssignedUserAssigned => "SystemAssigned, UserAssigned",
 020            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ResourceIdentityType value.")
 1621        };
 22
 23        public static ResourceIdentityType ToResourceIdentityType(this string value)
 24        {
 5625            if (string.Equals(value, "SystemAssigned", StringComparison.InvariantCultureIgnoreCase)) return ResourceIden
 026            if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return ResourceIdentityType.N
 027            if (string.Equals(value, "UserAssigned", StringComparison.InvariantCultureIgnoreCase)) return ResourceIdenti
 028            if (string.Equals(value, "SystemAssigned, UserAssigned", StringComparison.InvariantCultureIgnoreCase)) retur
 029            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ResourceIdentityType value.");
 30        }
 31    }
 32}