< Summary

Class:Azure.ResourceManager.Network.Models.TopologyResource
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\TopologyResource.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\TopologyResource.Serialization.cs
Covered lines:34
Uncovered lines:4
Coverable lines:38
Total lines:118
Line coverage:89.4% (34 of 38)
Covered branches:21
Total branches:22
Branch coverage:95.4% (21 of 22)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Name()-100%100%
get_Id()-100%100%
get_Location()-0%100%
get_Associations()-100%100%
DeserializeTopologyResource(...)-96.15%95.45%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\TopologyResource.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.Network.Models
 11{
 12    /// <summary> The network resource topology information for the given resource group. </summary>
 13    public partial class TopologyResource
 14    {
 15        /// <summary> Initializes a new instance of TopologyResource. </summary>
 016        internal TopologyResource()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of TopologyResource. </summary>
 21        /// <param name="name"> Name of the resource. </param>
 22        /// <param name="id"> ID of the resource. </param>
 23        /// <param name="location"> Resource location. </param>
 24        /// <param name="associations"> Holds the associations the resource has with other resources in the resource gro
 3625        internal TopologyResource(string name, string id, string location, IReadOnlyList<TopologyAssociation> associatio
 26        {
 3627            Name = name;
 3628            Id = id;
 3629            Location = location;
 3630            Associations = associations;
 3631        }
 32
 33        /// <summary> Name of the resource. </summary>
 434        public string Name { get; }
 35        /// <summary> ID of the resource. </summary>
 436        public string Id { get; }
 37        /// <summary> Resource location. </summary>
 038        public string Location { get; }
 39        /// <summary> Holds the associations the resource has with other resources in the resource group. </summary>
 1240        public IReadOnlyList<TopologyAssociation> Associations { get; }
 41    }
 42}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\TopologyResource.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.Network.Models
 13{
 14    public partial class TopologyResource
 15    {
 16        internal static TopologyResource DeserializeTopologyResource(JsonElement element)
 17        {
 3618            string name = default;
 3619            string id = default;
 3620            string location = default;
 3621            IReadOnlyList<TopologyAssociation> associations = default;
 43222            foreach (var property in element.EnumerateObject())
 23            {
 18024                if (property.NameEquals("name"))
 25                {
 3626                    if (property.Value.ValueKind == JsonValueKind.Null)
 27                    {
 28                        continue;
 29                    }
 3630                    name = property.Value.GetString();
 3631                    continue;
 32                }
 14433                if (property.NameEquals("id"))
 34                {
 3635                    if (property.Value.ValueKind == JsonValueKind.Null)
 36                    {
 37                        continue;
 38                    }
 3639                    id = property.Value.GetString();
 3640                    continue;
 41                }
 10842                if (property.NameEquals("location"))
 43                {
 3644                    if (property.Value.ValueKind == JsonValueKind.Null)
 45                    {
 46                        continue;
 47                    }
 3648                    location = property.Value.GetString();
 3649                    continue;
 50                }
 7251                if (property.NameEquals("associations"))
 52                {
 3653                    if (property.Value.ValueKind == JsonValueKind.Null)
 54                    {
 55                        continue;
 56                    }
 3657                    List<TopologyAssociation> array = new List<TopologyAssociation>();
 16058                    foreach (var item in property.Value.EnumerateArray())
 59                    {
 4460                        if (item.ValueKind == JsonValueKind.Null)
 61                        {
 062                            array.Add(null);
 63                        }
 64                        else
 65                        {
 4466                            array.Add(TopologyAssociation.DeserializeTopologyAssociation(item));
 67                        }
 68                    }
 3669                    associations = array;
 70                    continue;
 71                }
 72            }
 3673            return new TopologyResource(name, id, location, associations);
 74        }
 75    }
 76}