< Summary

Class:Azure.ResourceManager.Network.Models.TopologyAssociation
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\TopologyAssociation.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\TopologyAssociation.Serialization.cs
Covered lines:24
Uncovered lines:2
Coverable lines:26
Total lines:89
Line coverage:92.3% (24 of 26)
Covered branches:14
Total branches:14
Branch coverage:100% (14 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Name()-100%100%
get_ResourceId()-100%100%
get_AssociationType()-100%100%
DeserializeTopologyAssociation(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\TopologyAssociation.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
 8namespace Azure.ResourceManager.Network.Models
 9{
 10    /// <summary> Resources that have an association with the parent resource. </summary>
 11    public partial class TopologyAssociation
 12    {
 13        /// <summary> Initializes a new instance of TopologyAssociation. </summary>
 014        internal TopologyAssociation()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of TopologyAssociation. </summary>
 19        /// <param name="name"> The name of the resource that is associated with the parent resource. </param>
 20        /// <param name="resourceId"> The ID of the resource that is associated with the parent resource. </param>
 21        /// <param name="associationType"> The association type of the child resource to the parent resource. </param>
 4422        internal TopologyAssociation(string name, string resourceId, AssociationType? associationType)
 23        {
 4424            Name = name;
 4425            ResourceId = resourceId;
 4426            AssociationType = associationType;
 4427        }
 28
 29        /// <summary> The name of the resource that is associated with the parent resource. </summary>
 430        public string Name { get; }
 31        /// <summary> The ID of the resource that is associated with the parent resource. </summary>
 432        public string ResourceId { get; }
 33        /// <summary> The association type of the child resource to the parent resource. </summary>
 434        public AssociationType? AssociationType { get; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\TopologyAssociation.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Network.Models
 12{
 13    public partial class TopologyAssociation
 14    {
 15        internal static TopologyAssociation DeserializeTopologyAssociation(JsonElement element)
 16        {
 4417            string name = default;
 4418            string resourceId = default;
 4419            AssociationType? associationType = default;
 35220            foreach (var property in element.EnumerateObject())
 21            {
 13222                if (property.NameEquals("name"))
 23                {
 4424                    if (property.Value.ValueKind == JsonValueKind.Null)
 25                    {
 26                        continue;
 27                    }
 4428                    name = property.Value.GetString();
 4429                    continue;
 30                }
 8831                if (property.NameEquals("resourceId"))
 32                {
 4433                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 4437                    resourceId = property.Value.GetString();
 4438                    continue;
 39                }
 4440                if (property.NameEquals("associationType"))
 41                {
 4442                    if (property.Value.ValueKind == JsonValueKind.Null)
 43                    {
 44                        continue;
 45                    }
 4446                    associationType = new AssociationType(property.Value.GetString());
 47                    continue;
 48                }
 49            }
 4450            return new TopologyAssociation(name, resourceId, associationType);
 51        }
 52    }
 53}