< Summary

Class:Azure.ResourceManager.Resources.Models.TenantIdDescription
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\TenantIdDescription.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\TenantIdDescription.Serialization.cs
Covered lines:32
Uncovered lines:27
Coverable lines:59
Total lines:160
Line coverage:54.2% (32 of 59)
Covered branches:18
Total branches:34
Branch coverage:52.9% (18 of 34)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Id()-100%100%
get_TenantId()-100%100%
get_TenantCategory()-0%100%
get_Country()-0%100%
get_CountryCode()-0%100%
get_DisplayName()-0%100%
get_Domains()-0%100%
DeserializeTenantIdDescription(...)-51.22%52.94%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\TenantIdDescription.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.Collections.Generic;
 9
 10namespace Azure.ResourceManager.Resources.Models
 11{
 12    /// <summary> Tenant Id information. </summary>
 13    public partial class TenantIdDescription
 14    {
 15        /// <summary> Initializes a new instance of TenantIdDescription. </summary>
 016        internal TenantIdDescription()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of TenantIdDescription. </summary>
 21        /// <param name="id"> The fully qualified ID of the tenant. For example, /tenants/00000000-0000-0000-0000-000000
 22        /// <param name="tenantId"> The tenant ID. For example, 00000000-0000-0000-0000-000000000000. </param>
 23        /// <param name="tenantCategory"> Category of the tenant. </param>
 24        /// <param name="country"> Country/region name of the address for the tenant. </param>
 25        /// <param name="countryCode"> Country/region abbreviation for the tenant. </param>
 26        /// <param name="displayName"> The display name of the tenant. </param>
 27        /// <param name="domains"> The list of domains for the tenant. </param>
 428        internal TenantIdDescription(string id, string tenantId, TenantCategory? tenantCategory, string country, string 
 29        {
 430            Id = id;
 431            TenantId = tenantId;
 432            TenantCategory = tenantCategory;
 433            Country = country;
 434            CountryCode = countryCode;
 435            DisplayName = displayName;
 436            Domains = domains;
 437        }
 38
 39        /// <summary> The fully qualified ID of the tenant. For example, /tenants/00000000-0000-0000-0000-000000000000. 
 440        public string Id { get; }
 41        /// <summary> The tenant ID. For example, 00000000-0000-0000-0000-000000000000. </summary>
 442        public string TenantId { get; }
 43        /// <summary> Category of the tenant. </summary>
 044        public TenantCategory? TenantCategory { get; }
 45        /// <summary> Country/region name of the address for the tenant. </summary>
 046        public string Country { get; }
 47        /// <summary> Country/region abbreviation for the tenant. </summary>
 048        public string CountryCode { get; }
 49        /// <summary> The display name of the tenant. </summary>
 050        public string DisplayName { get; }
 51        /// <summary> The list of domains for the tenant. </summary>
 052        public IReadOnlyList<string> Domains { get; }
 53    }
 54}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\TenantIdDescription.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Resources.Models
 13{
 14    public partial class TenantIdDescription
 15    {
 16        internal static TenantIdDescription DeserializeTenantIdDescription(JsonElement element)
 17        {
 418            string id = default;
 419            string tenantId = default;
 420            TenantCategory? tenantCategory = default;
 421            string country = default;
 422            string countryCode = default;
 423            string displayName = default;
 424            IReadOnlyList<string> domains = default;
 3225            foreach (var property in element.EnumerateObject())
 26            {
 1227                if (property.NameEquals("id"))
 28                {
 429                    if (property.Value.ValueKind == JsonValueKind.Null)
 30                    {
 31                        continue;
 32                    }
 433                    id = property.Value.GetString();
 434                    continue;
 35                }
 836                if (property.NameEquals("tenantId"))
 37                {
 438                    if (property.Value.ValueKind == JsonValueKind.Null)
 39                    {
 40                        continue;
 41                    }
 442                    tenantId = property.Value.GetString();
 443                    continue;
 44                }
 445                if (property.NameEquals("tenantCategory"))
 46                {
 447                    if (property.Value.ValueKind == JsonValueKind.Null)
 48                    {
 49                        continue;
 50                    }
 451                    tenantCategory = property.Value.GetString().ToTenantCategory();
 452                    continue;
 53                }
 054                if (property.NameEquals("country"))
 55                {
 056                    if (property.Value.ValueKind == JsonValueKind.Null)
 57                    {
 58                        continue;
 59                    }
 060                    country = property.Value.GetString();
 061                    continue;
 62                }
 063                if (property.NameEquals("countryCode"))
 64                {
 065                    if (property.Value.ValueKind == JsonValueKind.Null)
 66                    {
 67                        continue;
 68                    }
 069                    countryCode = property.Value.GetString();
 070                    continue;
 71                }
 072                if (property.NameEquals("displayName"))
 73                {
 074                    if (property.Value.ValueKind == JsonValueKind.Null)
 75                    {
 76                        continue;
 77                    }
 078                    displayName = property.Value.GetString();
 079                    continue;
 80                }
 081                if (property.NameEquals("domains"))
 82                {
 083                    if (property.Value.ValueKind == JsonValueKind.Null)
 84                    {
 85                        continue;
 86                    }
 087                    List<string> array = new List<string>();
 088                    foreach (var item in property.Value.EnumerateArray())
 89                    {
 090                        if (item.ValueKind == JsonValueKind.Null)
 91                        {
 092                            array.Add(null);
 93                        }
 94                        else
 95                        {
 096                            array.Add(item.GetString());
 97                        }
 98                    }
 099                    domains = array;
 100                    continue;
 101                }
 102            }
 4103            return new TenantIdDescription(id, tenantId, tenantCategory, country, countryCode, displayName, domains);
 104        }
 105    }
 106}