< Summary

Class:Azure.ResourceManager.Network.Models.ConnectivityInformation
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectivityInformation.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectivityInformation.Serialization.cs
Covered lines:52
Uncovered lines:7
Coverable lines:59
Total lines:160
Line coverage:88.1% (52 of 59)
Covered branches:33
Total branches:34
Branch coverage:97% (33 of 34)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Hops()-100%100%
get_ConnectionStatus()-100%100%
get_AvgLatencyInMs()-0%100%
get_MinLatencyInMs()-0%100%
get_MaxLatencyInMs()-0%100%
get_ProbesSent()-0%100%
get_ProbesFailed()-100%100%
DeserializeConnectivityInformation(...)-97.56%97.06%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectivityInformation.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 on the connectivity status. </summary>
 13    public partial class ConnectivityInformation
 14    {
 15        /// <summary> Initializes a new instance of ConnectivityInformation. </summary>
 016        internal ConnectivityInformation()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ConnectivityInformation. </summary>
 21        /// <param name="hops"> List of hops between the source and the destination. </param>
 22        /// <param name="connectionStatus"> The connection status. </param>
 23        /// <param name="avgLatencyInMs"> Average latency in milliseconds. </param>
 24        /// <param name="minLatencyInMs"> Minimum latency in milliseconds. </param>
 25        /// <param name="maxLatencyInMs"> Maximum latency in milliseconds. </param>
 26        /// <param name="probesSent"> Total number of probes sent. </param>
 27        /// <param name="probesFailed"> Number of failed probes. </param>
 428        internal ConnectivityInformation(IReadOnlyList<ConnectivityHop> hops, ConnectionStatus? connectionStatus, int? a
 29        {
 430            Hops = hops;
 431            ConnectionStatus = connectionStatus;
 432            AvgLatencyInMs = avgLatencyInMs;
 433            MinLatencyInMs = minLatencyInMs;
 434            MaxLatencyInMs = maxLatencyInMs;
 435            ProbesSent = probesSent;
 436            ProbesFailed = probesFailed;
 437        }
 38
 39        /// <summary> List of hops between the source and the destination. </summary>
 840        public IReadOnlyList<ConnectivityHop> Hops { get; }
 41        /// <summary> The connection status. </summary>
 442        public ConnectionStatus? ConnectionStatus { get; }
 43        /// <summary> Average latency in milliseconds. </summary>
 044        public int? AvgLatencyInMs { get; }
 45        /// <summary> Minimum latency in milliseconds. </summary>
 046        public int? MinLatencyInMs { get; }
 47        /// <summary> Maximum latency in milliseconds. </summary>
 048        public int? MaxLatencyInMs { get; }
 49        /// <summary> Total number of probes sent. </summary>
 050        public int? ProbesSent { get; }
 51        /// <summary> Number of failed probes. </summary>
 452        public int? ProbesFailed { get; }
 53    }
 54}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectivityInformation.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 ConnectivityInformation
 15    {
 16        internal static ConnectivityInformation DeserializeConnectivityInformation(JsonElement element)
 17        {
 418            IReadOnlyList<ConnectivityHop> hops = default;
 419            ConnectionStatus? connectionStatus = default;
 420            int? avgLatencyInMs = default;
 421            int? minLatencyInMs = default;
 422            int? maxLatencyInMs = default;
 423            int? probesSent = default;
 424            int? probesFailed = default;
 6425            foreach (var property in element.EnumerateObject())
 26            {
 2827                if (property.NameEquals("hops"))
 28                {
 429                    if (property.Value.ValueKind == JsonValueKind.Null)
 30                    {
 31                        continue;
 32                    }
 433                    List<ConnectivityHop> array = new List<ConnectivityHop>();
 2434                    foreach (var item in property.Value.EnumerateArray())
 35                    {
 836                        if (item.ValueKind == JsonValueKind.Null)
 37                        {
 038                            array.Add(null);
 39                        }
 40                        else
 41                        {
 842                            array.Add(ConnectivityHop.DeserializeConnectivityHop(item));
 43                        }
 44                    }
 445                    hops = array;
 446                    continue;
 47                }
 2448                if (property.NameEquals("connectionStatus"))
 49                {
 450                    if (property.Value.ValueKind == JsonValueKind.Null)
 51                    {
 52                        continue;
 53                    }
 454                    connectionStatus = new ConnectionStatus(property.Value.GetString());
 455                    continue;
 56                }
 2057                if (property.NameEquals("avgLatencyInMs"))
 58                {
 459                    if (property.Value.ValueKind == JsonValueKind.Null)
 60                    {
 61                        continue;
 62                    }
 463                    avgLatencyInMs = property.Value.GetInt32();
 464                    continue;
 65                }
 1666                if (property.NameEquals("minLatencyInMs"))
 67                {
 468                    if (property.Value.ValueKind == JsonValueKind.Null)
 69                    {
 70                        continue;
 71                    }
 472                    minLatencyInMs = property.Value.GetInt32();
 473                    continue;
 74                }
 1275                if (property.NameEquals("maxLatencyInMs"))
 76                {
 477                    if (property.Value.ValueKind == JsonValueKind.Null)
 78                    {
 79                        continue;
 80                    }
 481                    maxLatencyInMs = property.Value.GetInt32();
 482                    continue;
 83                }
 884                if (property.NameEquals("probesSent"))
 85                {
 486                    if (property.Value.ValueKind == JsonValueKind.Null)
 87                    {
 88                        continue;
 89                    }
 490                    probesSent = property.Value.GetInt32();
 491                    continue;
 92                }
 493                if (property.NameEquals("probesFailed"))
 94                {
 495                    if (property.Value.ValueKind == JsonValueKind.Null)
 96                    {
 97                        continue;
 98                    }
 499                    probesFailed = property.Value.GetInt32();
 100                    continue;
 101                }
 102            }
 4103            return new ConnectivityInformation(hops, connectionStatus, avgLatencyInMs, minLatencyInMs, maxLatencyInMs, p
 104        }
 105    }
 106}