< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Name()-0%100%
get_DestinationType()-0%100%
get_Destinations()-0%100%
get_NextHopType()-0%100%
get_NextHop()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeHubRoute(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\HubRoute.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> RouteTable route. </summary>
 15    public partial class HubRoute
 16    {
 17        /// <summary> Initializes a new instance of HubRoute. </summary>
 18        /// <param name="name"> The name of the Route that is unique within a RouteTable. This name can be used to acces
 19        /// <param name="destinationType"> The type of destinations (eg: CIDR, ResourceId, Service). </param>
 20        /// <param name="destinations"> List of all destinations. </param>
 21        /// <param name="nextHopType"> The type of next hop (eg: ResourceId). </param>
 22        /// <param name="nextHop"> NextHop resource ID. </param>
 023        public HubRoute(string name, string destinationType, IEnumerable<string> destinations, string nextHopType, strin
 24        {
 025            if (name == null)
 26            {
 027                throw new ArgumentNullException(nameof(name));
 28            }
 029            if (destinationType == null)
 30            {
 031                throw new ArgumentNullException(nameof(destinationType));
 32            }
 033            if (destinations == null)
 34            {
 035                throw new ArgumentNullException(nameof(destinations));
 36            }
 037            if (nextHopType == null)
 38            {
 039                throw new ArgumentNullException(nameof(nextHopType));
 40            }
 041            if (nextHop == null)
 42            {
 043                throw new ArgumentNullException(nameof(nextHop));
 44            }
 45
 046            Name = name;
 047            DestinationType = destinationType;
 048            Destinations = destinations.ToList();
 049            NextHopType = nextHopType;
 050            NextHop = nextHop;
 051        }
 52
 53        /// <summary> Initializes a new instance of HubRoute. </summary>
 54        /// <param name="name"> The name of the Route that is unique within a RouteTable. This name can be used to acces
 55        /// <param name="destinationType"> The type of destinations (eg: CIDR, ResourceId, Service). </param>
 56        /// <param name="destinations"> List of all destinations. </param>
 57        /// <param name="nextHopType"> The type of next hop (eg: ResourceId). </param>
 58        /// <param name="nextHop"> NextHop resource ID. </param>
 059        internal HubRoute(string name, string destinationType, IList<string> destinations, string nextHopType, string ne
 60        {
 061            Name = name;
 062            DestinationType = destinationType;
 063            Destinations = destinations ?? new List<string>();
 064            NextHopType = nextHopType;
 065            NextHop = nextHop;
 066        }
 67
 68        /// <summary> The name of the Route that is unique within a RouteTable. This name can be used to access this rou
 069        public string Name { get; set; }
 70        /// <summary> The type of destinations (eg: CIDR, ResourceId, Service). </summary>
 071        public string DestinationType { get; set; }
 72        /// <summary> List of all destinations. </summary>
 073        public IList<string> Destinations { get; }
 74        /// <summary> The type of next hop (eg: ResourceId). </summary>
 075        public string NextHopType { get; set; }
 76        /// <summary> NextHop resource ID. </summary>
 077        public string NextHop { get; set; }
 78    }
 79}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\HubRoute.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 HubRoute : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("name");
 020            writer.WriteStringValue(Name);
 021            writer.WritePropertyName("destinationType");
 022            writer.WriteStringValue(DestinationType);
 023            writer.WritePropertyName("destinations");
 024            writer.WriteStartArray();
 025            foreach (var item in Destinations)
 26            {
 027                writer.WriteStringValue(item);
 28            }
 029            writer.WriteEndArray();
 030            writer.WritePropertyName("nextHopType");
 031            writer.WriteStringValue(NextHopType);
 032            writer.WritePropertyName("nextHop");
 033            writer.WriteStringValue(NextHop);
 034            writer.WriteEndObject();
 035        }
 36
 37        internal static HubRoute DeserializeHubRoute(JsonElement element)
 38        {
 039            string name = default;
 040            string destinationType = default;
 041            IList<string> destinations = default;
 042            string nextHopType = default;
 043            string nextHop = default;
 044            foreach (var property in element.EnumerateObject())
 45            {
 046                if (property.NameEquals("name"))
 47                {
 048                    name = property.Value.GetString();
 049                    continue;
 50                }
 051                if (property.NameEquals("destinationType"))
 52                {
 053                    destinationType = property.Value.GetString();
 054                    continue;
 55                }
 056                if (property.NameEquals("destinations"))
 57                {
 058                    List<string> array = new List<string>();
 059                    foreach (var item in property.Value.EnumerateArray())
 60                    {
 061                        if (item.ValueKind == JsonValueKind.Null)
 62                        {
 063                            array.Add(null);
 64                        }
 65                        else
 66                        {
 067                            array.Add(item.GetString());
 68                        }
 69                    }
 070                    destinations = array;
 071                    continue;
 72                }
 073                if (property.NameEquals("nextHopType"))
 74                {
 075                    nextHopType = property.Value.GetString();
 076                    continue;
 77                }
 078                if (property.NameEquals("nextHop"))
 79                {
 080                    nextHop = property.Value.GetString();
 81                    continue;
 82                }
 83            }
 084            return new HubRoute(name, destinationType, destinations, nextHopType, nextHop);
 85        }
 86    }
 87}