< Summary

Class:Azure.ResourceManager.Resources.Models.Provider
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Provider.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Provider.Serialization.cs
Covered lines:41
Uncovered lines:4
Coverable lines:45
Total lines:132
Line coverage:91.1% (41 of 45)
Covered branches:25
Total branches:26
Branch coverage:96.1% (25 of 26)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Id()-100%100%
get_Namespace()-100%100%
get_RegistrationState()-100%100%
get_RegistrationPolicy()-0%100%
get_ResourceTypes()-100%100%
DeserializeProvider(...)-96.77%96.15%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Provider.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> Resource provider information. </summary>
 13    public partial class Provider
 14    {
 15        /// <summary> Initializes a new instance of Provider. </summary>
 016        internal Provider()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of Provider. </summary>
 21        /// <param name="id"> The provider ID. </param>
 22        /// <param name="namespace"> The namespace of the resource provider. </param>
 23        /// <param name="registrationState"> The registration state of the resource provider. </param>
 24        /// <param name="registrationPolicy"> The registration policy of the resource provider. </param>
 25        /// <param name="resourceTypes"> The collection of provider resource types. </param>
 161626        internal Provider(string id, string @namespace, string registrationState, string registrationPolicy, IReadOnlyLi
 27        {
 161628            Id = id;
 161629            Namespace = @namespace;
 161630            RegistrationState = registrationState;
 161631            RegistrationPolicy = registrationPolicy;
 161632            ResourceTypes = resourceTypes;
 161633        }
 34
 35        /// <summary> The provider ID. </summary>
 436        public string Id { get; }
 37        /// <summary> The namespace of the resource provider. </summary>
 12038        public string Namespace { get; }
 39        /// <summary> The registration state of the resource provider. </summary>
 5040        public string RegistrationState { get; }
 41        /// <summary> The registration policy of the resource provider. </summary>
 042        public string RegistrationPolicy { get; }
 43        /// <summary> The collection of provider resource types. </summary>
 8044        public IReadOnlyList<ProviderResourceType> ResourceTypes { get; }
 45    }
 46}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Provider.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 Provider
 15    {
 16        internal static Provider DeserializeProvider(JsonElement element)
 17        {
 161618            string id = default;
 161619            string @namespace = default;
 161620            string registrationState = default;
 161621            string registrationPolicy = default;
 161622            IReadOnlyList<ProviderResourceType> resourceTypes = default;
 2044023            foreach (var property in element.EnumerateObject())
 24            {
 860425                if (property.NameEquals("id"))
 26                {
 145227                    if (property.Value.ValueKind == JsonValueKind.Null)
 28                    {
 29                        continue;
 30                    }
 145231                    id = property.Value.GetString();
 145232                    continue;
 33                }
 715234                if (property.NameEquals("namespace"))
 35                {
 160836                    if (property.Value.ValueKind == JsonValueKind.Null)
 37                    {
 38                        continue;
 39                    }
 160840                    @namespace = property.Value.GetString();
 160841                    continue;
 42                }
 554443                if (property.NameEquals("registrationState"))
 44                {
 146045                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 146049                    registrationState = property.Value.GetString();
 146050                    continue;
 51                }
 408452                if (property.NameEquals("registrationPolicy"))
 53                {
 145254                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 145258                    registrationPolicy = property.Value.GetString();
 145259                    continue;
 60                }
 263261                if (property.NameEquals("resourceTypes"))
 62                {
 160863                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 160867                    List<ProviderResourceType> array = new List<ProviderResourceType>();
 3613668                    foreach (var item in property.Value.EnumerateArray())
 69                    {
 1646070                        if (item.ValueKind == JsonValueKind.Null)
 71                        {
 072                            array.Add(null);
 73                        }
 74                        else
 75                        {
 1646076                            array.Add(ProviderResourceType.DeserializeProviderResourceType(item));
 77                        }
 78                    }
 160879                    resourceTypes = array;
 80                    continue;
 81                }
 82            }
 161683            return new Provider(id, @namespace, registrationState, registrationPolicy, resourceTypes);
 84        }
 85    }
 86}