< Summary

Class:Azure.ResourceManager.Network.Models.ConnectionStateSnapshot
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionStateSnapshot.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionStateSnapshot.Serialization.cs
Covered lines:0
Uncovered lines:80
Coverable lines:80
Total lines:204
Line coverage:0% (0 of 80)
Covered branches:0
Total branches:46
Branch coverage:0% (0 of 46)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_ConnectionState()-0%100%
get_StartTime()-0%100%
get_EndTime()-0%100%
get_EvaluationState()-0%100%
get_AvgLatencyInMs()-0%100%
get_MinLatencyInMs()-0%100%
get_MaxLatencyInMs()-0%100%
get_ProbesSent()-0%100%
get_ProbesFailed()-0%100%
get_Hops()-0%100%
DeserializeConnectionStateSnapshot(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionStateSnapshot.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;
 9using System.Collections.Generic;
 10
 11namespace Azure.ResourceManager.Network.Models
 12{
 13    /// <summary> Connection state snapshot. </summary>
 14    public partial class ConnectionStateSnapshot
 15    {
 16        /// <summary> Initializes a new instance of ConnectionStateSnapshot. </summary>
 017        internal ConnectionStateSnapshot()
 18        {
 019        }
 20
 21        /// <summary> Initializes a new instance of ConnectionStateSnapshot. </summary>
 22        /// <param name="connectionState"> The connection state. </param>
 23        /// <param name="startTime"> The start time of the connection snapshot. </param>
 24        /// <param name="endTime"> The end time of the connection snapshot. </param>
 25        /// <param name="evaluationState"> Connectivity analysis evaluation state. </param>
 26        /// <param name="avgLatencyInMs"> Average latency in ms. </param>
 27        /// <param name="minLatencyInMs"> Minimum latency in ms. </param>
 28        /// <param name="maxLatencyInMs"> Maximum latency in ms. </param>
 29        /// <param name="probesSent"> The number of sent probes. </param>
 30        /// <param name="probesFailed"> The number of failed probes. </param>
 31        /// <param name="hops"> List of hops between the source and the destination. </param>
 032        internal ConnectionStateSnapshot(ConnectionState? connectionState, DateTimeOffset? startTime, DateTimeOffset? en
 33        {
 034            ConnectionState = connectionState;
 035            StartTime = startTime;
 036            EndTime = endTime;
 037            EvaluationState = evaluationState;
 038            AvgLatencyInMs = avgLatencyInMs;
 039            MinLatencyInMs = minLatencyInMs;
 040            MaxLatencyInMs = maxLatencyInMs;
 041            ProbesSent = probesSent;
 042            ProbesFailed = probesFailed;
 043            Hops = hops;
 044        }
 45
 46        /// <summary> The connection state. </summary>
 047        public ConnectionState? ConnectionState { get; }
 48        /// <summary> The start time of the connection snapshot. </summary>
 049        public DateTimeOffset? StartTime { get; }
 50        /// <summary> The end time of the connection snapshot. </summary>
 051        public DateTimeOffset? EndTime { get; }
 52        /// <summary> Connectivity analysis evaluation state. </summary>
 053        public EvaluationState? EvaluationState { get; }
 54        /// <summary> Average latency in ms. </summary>
 055        public int? AvgLatencyInMs { get; }
 56        /// <summary> Minimum latency in ms. </summary>
 057        public int? MinLatencyInMs { get; }
 58        /// <summary> Maximum latency in ms. </summary>
 059        public int? MaxLatencyInMs { get; }
 60        /// <summary> The number of sent probes. </summary>
 061        public int? ProbesSent { get; }
 62        /// <summary> The number of failed probes. </summary>
 063        public int? ProbesFailed { get; }
 64        /// <summary> List of hops between the source and the destination. </summary>
 065        public IReadOnlyList<ConnectivityHop> Hops { get; }
 66    }
 67}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionStateSnapshot.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;
 9using System.Collections.Generic;
 10using System.Text.Json;
 11using Azure.Core;
 12
 13namespace Azure.ResourceManager.Network.Models
 14{
 15    public partial class ConnectionStateSnapshot
 16    {
 17        internal static ConnectionStateSnapshot DeserializeConnectionStateSnapshot(JsonElement element)
 18        {
 019            ConnectionState? connectionState = default;
 020            DateTimeOffset? startTime = default;
 021            DateTimeOffset? endTime = default;
 022            EvaluationState? evaluationState = default;
 023            int? avgLatencyInMs = default;
 024            int? minLatencyInMs = default;
 025            int? maxLatencyInMs = default;
 026            int? probesSent = default;
 027            int? probesFailed = default;
 028            IReadOnlyList<ConnectivityHop> hops = default;
 029            foreach (var property in element.EnumerateObject())
 30            {
 031                if (property.NameEquals("connectionState"))
 32                {
 033                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 037                    connectionState = new ConnectionState(property.Value.GetString());
 038                    continue;
 39                }
 040                if (property.NameEquals("startTime"))
 41                {
 042                    if (property.Value.ValueKind == JsonValueKind.Null)
 43                    {
 44                        continue;
 45                    }
 046                    startTime = property.Value.GetDateTimeOffset("O");
 047                    continue;
 48                }
 049                if (property.NameEquals("endTime"))
 50                {
 051                    if (property.Value.ValueKind == JsonValueKind.Null)
 52                    {
 53                        continue;
 54                    }
 055                    endTime = property.Value.GetDateTimeOffset("O");
 056                    continue;
 57                }
 058                if (property.NameEquals("evaluationState"))
 59                {
 060                    if (property.Value.ValueKind == JsonValueKind.Null)
 61                    {
 62                        continue;
 63                    }
 064                    evaluationState = new EvaluationState(property.Value.GetString());
 065                    continue;
 66                }
 067                if (property.NameEquals("avgLatencyInMs"))
 68                {
 069                    if (property.Value.ValueKind == JsonValueKind.Null)
 70                    {
 71                        continue;
 72                    }
 073                    avgLatencyInMs = property.Value.GetInt32();
 074                    continue;
 75                }
 076                if (property.NameEquals("minLatencyInMs"))
 77                {
 078                    if (property.Value.ValueKind == JsonValueKind.Null)
 79                    {
 80                        continue;
 81                    }
 082                    minLatencyInMs = property.Value.GetInt32();
 083                    continue;
 84                }
 085                if (property.NameEquals("maxLatencyInMs"))
 86                {
 087                    if (property.Value.ValueKind == JsonValueKind.Null)
 88                    {
 89                        continue;
 90                    }
 091                    maxLatencyInMs = property.Value.GetInt32();
 092                    continue;
 93                }
 094                if (property.NameEquals("probesSent"))
 95                {
 096                    if (property.Value.ValueKind == JsonValueKind.Null)
 97                    {
 98                        continue;
 99                    }
 0100                    probesSent = property.Value.GetInt32();
 0101                    continue;
 102                }
 0103                if (property.NameEquals("probesFailed"))
 104                {
 0105                    if (property.Value.ValueKind == JsonValueKind.Null)
 106                    {
 107                        continue;
 108                    }
 0109                    probesFailed = property.Value.GetInt32();
 0110                    continue;
 111                }
 0112                if (property.NameEquals("hops"))
 113                {
 0114                    if (property.Value.ValueKind == JsonValueKind.Null)
 115                    {
 116                        continue;
 117                    }
 0118                    List<ConnectivityHop> array = new List<ConnectivityHop>();
 0119                    foreach (var item in property.Value.EnumerateArray())
 120                    {
 0121                        if (item.ValueKind == JsonValueKind.Null)
 122                        {
 0123                            array.Add(null);
 124                        }
 125                        else
 126                        {
 0127                            array.Add(ConnectivityHop.DeserializeConnectivityHop(item));
 128                        }
 129                    }
 0130                    hops = array;
 131                    continue;
 132                }
 133            }
 0134            return new ConnectionStateSnapshot(connectionState, startTime, endTime, evaluationState, avgLatencyInMs, min
 135        }
 136    }
 137}