< Summary

Class:Azure.ResourceManager.Resources.Models.TenantCategoryExtensions
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\TenantCategory.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%
ToTenantCategory(...)-25%16.67%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\TenantCategory.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 TenantCategoryExtensions
 13    {
 014        public static string ToSerialString(this TenantCategory value) => value switch
 015        {
 016            TenantCategory.Home => "Home",
 017            TenantCategory.ProjectedBy => "ProjectedBy",
 018            TenantCategory.ManagedBy => "ManagedBy",
 019            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TenantCategory value.")
 020        };
 21
 22        public static TenantCategory ToTenantCategory(this string value)
 23        {
 824            if (string.Equals(value, "Home", StringComparison.InvariantCultureIgnoreCase)) return TenantCategory.Home;
 025            if (string.Equals(value, "ProjectedBy", StringComparison.InvariantCultureIgnoreCase)) return TenantCategory.
 026            if (string.Equals(value, "ManagedBy", StringComparison.InvariantCultureIgnoreCase)) return TenantCategory.Ma
 027            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TenantCategory value.");
 28        }
 29    }
 30}