< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Name()-0%100%
get_Disable()-0%100%
get_TestConfigurations()-0%100%
get_Sources()-0%100%
get_Destinations()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeConnectionMonitorTestGroup(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionMonitorTestGroup.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.Linq;
 11
 12namespace Azure.ResourceManager.Network.Models
 13{
 14    /// <summary> Describes the connection monitor test group. </summary>
 15    public partial class ConnectionMonitorTestGroup
 16    {
 17        /// <summary> Initializes a new instance of ConnectionMonitorTestGroup. </summary>
 18        /// <param name="name"> The name of the connection monitor test group. </param>
 19        /// <param name="testConfigurations"> List of test configuration names. </param>
 20        /// <param name="sources"> List of source endpoint names. </param>
 21        /// <param name="destinations"> List of destination endpoint names. </param>
 022        public ConnectionMonitorTestGroup(string name, IEnumerable<string> testConfigurations, IEnumerable<string> sourc
 23        {
 024            if (name == null)
 25            {
 026                throw new ArgumentNullException(nameof(name));
 27            }
 028            if (testConfigurations == null)
 29            {
 030                throw new ArgumentNullException(nameof(testConfigurations));
 31            }
 032            if (sources == null)
 33            {
 034                throw new ArgumentNullException(nameof(sources));
 35            }
 036            if (destinations == null)
 37            {
 038                throw new ArgumentNullException(nameof(destinations));
 39            }
 40
 041            Name = name;
 042            TestConfigurations = testConfigurations.ToList();
 043            Sources = sources.ToList();
 044            Destinations = destinations.ToList();
 045        }
 46
 47        /// <summary> Initializes a new instance of ConnectionMonitorTestGroup. </summary>
 48        /// <param name="name"> The name of the connection monitor test group. </param>
 49        /// <param name="disable"> Value indicating whether test group is disabled. </param>
 50        /// <param name="testConfigurations"> List of test configuration names. </param>
 51        /// <param name="sources"> List of source endpoint names. </param>
 52        /// <param name="destinations"> List of destination endpoint names. </param>
 053        internal ConnectionMonitorTestGroup(string name, bool? disable, IList<string> testConfigurations, IList<string> 
 54        {
 055            Name = name;
 056            Disable = disable;
 057            TestConfigurations = testConfigurations ?? new List<string>();
 058            Sources = sources ?? new List<string>();
 059            Destinations = destinations ?? new List<string>();
 060        }
 61
 62        /// <summary> The name of the connection monitor test group. </summary>
 063        public string Name { get; set; }
 64        /// <summary> Value indicating whether test group is disabled. </summary>
 065        public bool? Disable { get; set; }
 66        /// <summary> List of test configuration names. </summary>
 067        public IList<string> TestConfigurations { get; }
 68        /// <summary> List of source endpoint names. </summary>
 069        public IList<string> Sources { get; }
 70        /// <summary> List of destination endpoint names. </summary>
 071        public IList<string> Destinations { get; }
 72    }
 73}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionMonitorTestGroup.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 ConnectionMonitorTestGroup : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("name");
 020            writer.WriteStringValue(Name);
 021            if (Disable != null)
 22            {
 023                writer.WritePropertyName("disable");
 024                writer.WriteBooleanValue(Disable.Value);
 25            }
 026            writer.WritePropertyName("testConfigurations");
 027            writer.WriteStartArray();
 028            foreach (var item in TestConfigurations)
 29            {
 030                writer.WriteStringValue(item);
 31            }
 032            writer.WriteEndArray();
 033            writer.WritePropertyName("sources");
 034            writer.WriteStartArray();
 035            foreach (var item in Sources)
 36            {
 037                writer.WriteStringValue(item);
 38            }
 039            writer.WriteEndArray();
 040            writer.WritePropertyName("destinations");
 041            writer.WriteStartArray();
 042            foreach (var item in Destinations)
 43            {
 044                writer.WriteStringValue(item);
 45            }
 046            writer.WriteEndArray();
 047            writer.WriteEndObject();
 048        }
 49
 50        internal static ConnectionMonitorTestGroup DeserializeConnectionMonitorTestGroup(JsonElement element)
 51        {
 052            string name = default;
 053            bool? disable = default;
 054            IList<string> testConfigurations = default;
 055            IList<string> sources = default;
 056            IList<string> destinations = default;
 057            foreach (var property in element.EnumerateObject())
 58            {
 059                if (property.NameEquals("name"))
 60                {
 061                    name = property.Value.GetString();
 062                    continue;
 63                }
 064                if (property.NameEquals("disable"))
 65                {
 066                    if (property.Value.ValueKind == JsonValueKind.Null)
 67                    {
 68                        continue;
 69                    }
 070                    disable = property.Value.GetBoolean();
 071                    continue;
 72                }
 073                if (property.NameEquals("testConfigurations"))
 74                {
 075                    List<string> array = new List<string>();
 076                    foreach (var item in property.Value.EnumerateArray())
 77                    {
 078                        if (item.ValueKind == JsonValueKind.Null)
 79                        {
 080                            array.Add(null);
 81                        }
 82                        else
 83                        {
 084                            array.Add(item.GetString());
 85                        }
 86                    }
 087                    testConfigurations = array;
 088                    continue;
 89                }
 090                if (property.NameEquals("sources"))
 91                {
 092                    List<string> array = new List<string>();
 093                    foreach (var item in property.Value.EnumerateArray())
 94                    {
 095                        if (item.ValueKind == JsonValueKind.Null)
 96                        {
 097                            array.Add(null);
 98                        }
 99                        else
 100                        {
 0101                            array.Add(item.GetString());
 102                        }
 103                    }
 0104                    sources = array;
 0105                    continue;
 106                }
 0107                if (property.NameEquals("destinations"))
 108                {
 0109                    List<string> array = new List<string>();
 0110                    foreach (var item in property.Value.EnumerateArray())
 111                    {
 0112                        if (item.ValueKind == JsonValueKind.Null)
 113                        {
 0114                            array.Add(null);
 115                        }
 116                        else
 117                        {
 0118                            array.Add(item.GetString());
 119                        }
 120                    }
 0121                    destinations = array;
 122                    continue;
 123                }
 124            }
 0125            return new ConnectionMonitorTestGroup(name, disable, testConfigurations, sources, destinations);
 126        }
 127    }
 128}