< Summary

Class:Azure.ResourceManager.Network.Models.ConnectivityHop
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectivityHop.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectivityHop.Serialization.cs
Covered lines:45
Uncovered lines:12
Coverable lines:57
Total lines:158
Line coverage:78.9% (45 of 57)
Covered branches:30
Total branches:34
Branch coverage:88.2% (30 of 34)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Type()-100%100%
get_Id()-0%100%
get_Address()-0%100%
get_ResourceId()-0%100%
get_NextHopIds()-0%100%
get_Issues()-0%100%
DeserializeConnectivityHop(...)-87.8%88.24%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectivityHop.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> Information about a hop between the source and the destination. </summary>
 13    public partial class ConnectivityHop
 14    {
 15        /// <summary> Initializes a new instance of ConnectivityHop. </summary>
 016        internal ConnectivityHop()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ConnectivityHop. </summary>
 21        /// <param name="type"> The type of the hop. </param>
 22        /// <param name="id"> The ID of the hop. </param>
 23        /// <param name="address"> The IP address of the hop. </param>
 24        /// <param name="resourceId"> The ID of the resource corresponding to this hop. </param>
 25        /// <param name="nextHopIds"> List of next hop identifiers. </param>
 26        /// <param name="issues"> List of issues. </param>
 827        internal ConnectivityHop(string type, string id, string address, string resourceId, IReadOnlyList<string> nextHo
 28        {
 829            Type = type;
 830            Id = id;
 831            Address = address;
 832            ResourceId = resourceId;
 833            NextHopIds = nextHopIds;
 834            Issues = issues;
 835        }
 36
 37        /// <summary> The type of the hop. </summary>
 838        public string Type { get; }
 39        /// <summary> The ID of the hop. </summary>
 040        public string Id { get; }
 41        /// <summary> The IP address of the hop. </summary>
 042        public string Address { get; }
 43        /// <summary> The ID of the resource corresponding to this hop. </summary>
 044        public string ResourceId { get; }
 45        /// <summary> List of next hop identifiers. </summary>
 046        public IReadOnlyList<string> NextHopIds { get; }
 47        /// <summary> List of issues. </summary>
 048        public IReadOnlyList<ConnectivityIssue> Issues { get; }
 49    }
 50}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectivityHop.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 ConnectivityHop
 15    {
 16        internal static ConnectivityHop DeserializeConnectivityHop(JsonElement element)
 17        {
 818            string type = default;
 819            string id = default;
 820            string address = default;
 821            string resourceId = default;
 822            IReadOnlyList<string> nextHopIds = default;
 823            IReadOnlyList<ConnectivityIssue> issues = default;
 15224            foreach (var property in element.EnumerateObject())
 25            {
 6826                if (property.NameEquals("type"))
 27                {
 828                    if (property.Value.ValueKind == JsonValueKind.Null)
 29                    {
 30                        continue;
 31                    }
 832                    type = property.Value.GetString();
 833                    continue;
 34                }
 6035                if (property.NameEquals("id"))
 36                {
 837                    if (property.Value.ValueKind == JsonValueKind.Null)
 38                    {
 39                        continue;
 40                    }
 841                    id = property.Value.GetString();
 842                    continue;
 43                }
 5244                if (property.NameEquals("address"))
 45                {
 846                    if (property.Value.ValueKind == JsonValueKind.Null)
 47                    {
 48                        continue;
 49                    }
 850                    address = property.Value.GetString();
 851                    continue;
 52                }
 4453                if (property.NameEquals("resourceId"))
 54                {
 455                    if (property.Value.ValueKind == JsonValueKind.Null)
 56                    {
 57                        continue;
 58                    }
 459                    resourceId = property.Value.GetString();
 460                    continue;
 61                }
 4062                if (property.NameEquals("nextHopIds"))
 63                {
 864                    if (property.Value.ValueKind == JsonValueKind.Null)
 65                    {
 66                        continue;
 67                    }
 868                    List<string> array = new List<string>();
 2469                    foreach (var item in property.Value.EnumerateArray())
 70                    {
 471                        if (item.ValueKind == JsonValueKind.Null)
 72                        {
 073                            array.Add(null);
 74                        }
 75                        else
 76                        {
 477                            array.Add(item.GetString());
 78                        }
 79                    }
 880                    nextHopIds = array;
 881                    continue;
 82                }
 3283                if (property.NameEquals("issues"))
 84                {
 885                    if (property.Value.ValueKind == JsonValueKind.Null)
 86                    {
 87                        continue;
 88                    }
 889                    List<ConnectivityIssue> array = new List<ConnectivityIssue>();
 090                    foreach (var item in property.Value.EnumerateArray())
 91                    {
 092                        if (item.ValueKind == JsonValueKind.Null)
 93                        {
 094                            array.Add(null);
 95                        }
 96                        else
 97                        {
 098                            array.Add(ConnectivityIssue.DeserializeConnectivityIssue(item));
 99                        }
 100                    }
 8101                    issues = array;
 102                    continue;
 103                }
 104            }
 8105            return new ConnectivityHop(type, id, address, resourceId, nextHopIds, issues);
 106        }
 107    }
 108}