< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Name()-0%100%
get_TestFrequencySec()-0%100%
get_Protocol()-0%100%
get_PreferredIPVersion()-0%100%
get_HttpConfiguration()-0%100%
get_TcpConfiguration()-0%100%
get_IcmpConfiguration()-0%100%
get_SuccessThreshold()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeConnectionMonitorTestConfiguration(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionMonitorTestConfiguration.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;
 9
 10namespace Azure.ResourceManager.Network.Models
 11{
 12    /// <summary> Describes a connection monitor test configuration. </summary>
 13    public partial class ConnectionMonitorTestConfiguration
 14    {
 15        /// <summary> Initializes a new instance of ConnectionMonitorTestConfiguration. </summary>
 16        /// <param name="name"> The name of the connection monitor test configuration. </param>
 17        /// <param name="protocol"> The protocol to use in test evaluation. </param>
 018        public ConnectionMonitorTestConfiguration(string name, ConnectionMonitorTestConfigurationProtocol protocol)
 19        {
 020            if (name == null)
 21            {
 022                throw new ArgumentNullException(nameof(name));
 23            }
 24
 025            Name = name;
 026            Protocol = protocol;
 027        }
 28
 29        /// <summary> Initializes a new instance of ConnectionMonitorTestConfiguration. </summary>
 30        /// <param name="name"> The name of the connection monitor test configuration. </param>
 31        /// <param name="testFrequencySec"> The frequency of test evaluation, in seconds. </param>
 32        /// <param name="protocol"> The protocol to use in test evaluation. </param>
 33        /// <param name="preferredIPVersion"> The preferred IP version to use in test evaluation. The connection monitor
 34        /// <param name="httpConfiguration"> The parameters used to perform test evaluation over HTTP. </param>
 35        /// <param name="tcpConfiguration"> The parameters used to perform test evaluation over TCP. </param>
 36        /// <param name="icmpConfiguration"> The parameters used to perform test evaluation over ICMP. </param>
 37        /// <param name="successThreshold"> The threshold for declaring a test successful. </param>
 038        internal ConnectionMonitorTestConfiguration(string name, int? testFrequencySec, ConnectionMonitorTestConfigurati
 39        {
 040            Name = name;
 041            TestFrequencySec = testFrequencySec;
 042            Protocol = protocol;
 043            PreferredIPVersion = preferredIPVersion;
 044            HttpConfiguration = httpConfiguration;
 045            TcpConfiguration = tcpConfiguration;
 046            IcmpConfiguration = icmpConfiguration;
 047            SuccessThreshold = successThreshold;
 048        }
 49
 50        /// <summary> The name of the connection monitor test configuration. </summary>
 051        public string Name { get; set; }
 52        /// <summary> The frequency of test evaluation, in seconds. </summary>
 053        public int? TestFrequencySec { get; set; }
 54        /// <summary> The protocol to use in test evaluation. </summary>
 055        public ConnectionMonitorTestConfigurationProtocol Protocol { get; set; }
 56        /// <summary> The preferred IP version to use in test evaluation. The connection monitor may choose to use a dif
 057        public PreferredIPVersion? PreferredIPVersion { get; set; }
 58        /// <summary> The parameters used to perform test evaluation over HTTP. </summary>
 059        public ConnectionMonitorHttpConfiguration HttpConfiguration { get; set; }
 60        /// <summary> The parameters used to perform test evaluation over TCP. </summary>
 061        public ConnectionMonitorTcpConfiguration TcpConfiguration { get; set; }
 62        /// <summary> The parameters used to perform test evaluation over ICMP. </summary>
 063        public ConnectionMonitorIcmpConfiguration IcmpConfiguration { get; set; }
 64        /// <summary> The threshold for declaring a test successful. </summary>
 065        public ConnectionMonitorSuccessThreshold SuccessThreshold { get; set; }
 66    }
 67}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionMonitorTestConfiguration.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 ConnectionMonitorTestConfiguration : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("name");
 019            writer.WriteStringValue(Name);
 020            if (TestFrequencySec != null)
 21            {
 022                writer.WritePropertyName("testFrequencySec");
 023                writer.WriteNumberValue(TestFrequencySec.Value);
 24            }
 025            writer.WritePropertyName("protocol");
 026            writer.WriteStringValue(Protocol.ToString());
 027            if (PreferredIPVersion != null)
 28            {
 029                writer.WritePropertyName("preferredIPVersion");
 030                writer.WriteStringValue(PreferredIPVersion.Value.ToString());
 31            }
 032            if (HttpConfiguration != null)
 33            {
 034                writer.WritePropertyName("httpConfiguration");
 035                writer.WriteObjectValue(HttpConfiguration);
 36            }
 037            if (TcpConfiguration != null)
 38            {
 039                writer.WritePropertyName("tcpConfiguration");
 040                writer.WriteObjectValue(TcpConfiguration);
 41            }
 042            if (IcmpConfiguration != null)
 43            {
 044                writer.WritePropertyName("icmpConfiguration");
 045                writer.WriteObjectValue(IcmpConfiguration);
 46            }
 047            if (SuccessThreshold != null)
 48            {
 049                writer.WritePropertyName("successThreshold");
 050                writer.WriteObjectValue(SuccessThreshold);
 51            }
 052            writer.WriteEndObject();
 053        }
 54
 55        internal static ConnectionMonitorTestConfiguration DeserializeConnectionMonitorTestConfiguration(JsonElement ele
 56        {
 057            string name = default;
 058            int? testFrequencySec = default;
 059            ConnectionMonitorTestConfigurationProtocol protocol = default;
 060            PreferredIPVersion? preferredIPVersion = default;
 061            ConnectionMonitorHttpConfiguration httpConfiguration = default;
 062            ConnectionMonitorTcpConfiguration tcpConfiguration = default;
 063            ConnectionMonitorIcmpConfiguration icmpConfiguration = default;
 064            ConnectionMonitorSuccessThreshold successThreshold = default;
 065            foreach (var property in element.EnumerateObject())
 66            {
 067                if (property.NameEquals("name"))
 68                {
 069                    name = property.Value.GetString();
 070                    continue;
 71                }
 072                if (property.NameEquals("testFrequencySec"))
 73                {
 074                    if (property.Value.ValueKind == JsonValueKind.Null)
 75                    {
 76                        continue;
 77                    }
 078                    testFrequencySec = property.Value.GetInt32();
 079                    continue;
 80                }
 081                if (property.NameEquals("protocol"))
 82                {
 083                    protocol = new ConnectionMonitorTestConfigurationProtocol(property.Value.GetString());
 084                    continue;
 85                }
 086                if (property.NameEquals("preferredIPVersion"))
 87                {
 088                    if (property.Value.ValueKind == JsonValueKind.Null)
 89                    {
 90                        continue;
 91                    }
 092                    preferredIPVersion = new PreferredIPVersion(property.Value.GetString());
 093                    continue;
 94                }
 095                if (property.NameEquals("httpConfiguration"))
 96                {
 097                    if (property.Value.ValueKind == JsonValueKind.Null)
 98                    {
 99                        continue;
 100                    }
 0101                    httpConfiguration = ConnectionMonitorHttpConfiguration.DeserializeConnectionMonitorHttpConfiguration
 0102                    continue;
 103                }
 0104                if (property.NameEquals("tcpConfiguration"))
 105                {
 0106                    if (property.Value.ValueKind == JsonValueKind.Null)
 107                    {
 108                        continue;
 109                    }
 0110                    tcpConfiguration = ConnectionMonitorTcpConfiguration.DeserializeConnectionMonitorTcpConfiguration(pr
 0111                    continue;
 112                }
 0113                if (property.NameEquals("icmpConfiguration"))
 114                {
 0115                    if (property.Value.ValueKind == JsonValueKind.Null)
 116                    {
 117                        continue;
 118                    }
 0119                    icmpConfiguration = ConnectionMonitorIcmpConfiguration.DeserializeConnectionMonitorIcmpConfiguration
 0120                    continue;
 121                }
 0122                if (property.NameEquals("successThreshold"))
 123                {
 0124                    if (property.Value.ValueKind == JsonValueKind.Null)
 125                    {
 126                        continue;
 127                    }
 0128                    successThreshold = ConnectionMonitorSuccessThreshold.DeserializeConnectionMonitorSuccessThreshold(pr
 129                    continue;
 130                }
 131            }
 0132            return new ConnectionMonitorTestConfiguration(name, testFrequencySec, protocol, preferredIPVersion, httpConf
 133        }
 134    }
 135}