< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_AddressPrefixes()-0%100%
get_NextHopIpAddress()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeVirtualHubRoute(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualHubRoute.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> VirtualHub route. </summary>
 13    public partial class VirtualHubRoute
 14    {
 15        /// <summary> Initializes a new instance of VirtualHubRoute. </summary>
 016        public VirtualHubRoute()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of VirtualHubRoute. </summary>
 21        /// <param name="addressPrefixes"> List of all addressPrefixes. </param>
 22        /// <param name="nextHopIpAddress"> NextHop ip address. </param>
 023        internal VirtualHubRoute(IList<string> addressPrefixes, string nextHopIpAddress)
 24        {
 025            AddressPrefixes = addressPrefixes;
 026            NextHopIpAddress = nextHopIpAddress;
 027        }
 28
 29        /// <summary> List of all addressPrefixes. </summary>
 030        public IList<string> AddressPrefixes { get; set; }
 31        /// <summary> NextHop ip address. </summary>
 032        public string NextHopIpAddress { get; set; }
 33    }
 34}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualHubRoute.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 VirtualHubRoute : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (AddressPrefixes != null)
 20            {
 021                writer.WritePropertyName("addressPrefixes");
 022                writer.WriteStartArray();
 023                foreach (var item in AddressPrefixes)
 24                {
 025                    writer.WriteStringValue(item);
 26                }
 027                writer.WriteEndArray();
 28            }
 029            if (NextHopIpAddress != null)
 30            {
 031                writer.WritePropertyName("nextHopIpAddress");
 032                writer.WriteStringValue(NextHopIpAddress);
 33            }
 034            writer.WriteEndObject();
 035        }
 36
 37        internal static VirtualHubRoute DeserializeVirtualHubRoute(JsonElement element)
 38        {
 039            IList<string> addressPrefixes = default;
 040            string nextHopIpAddress = default;
 041            foreach (var property in element.EnumerateObject())
 42            {
 043                if (property.NameEquals("addressPrefixes"))
 44                {
 045                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 049                    List<string> array = new List<string>();
 050                    foreach (var item in property.Value.EnumerateArray())
 51                    {
 052                        if (item.ValueKind == JsonValueKind.Null)
 53                        {
 054                            array.Add(null);
 55                        }
 56                        else
 57                        {
 058                            array.Add(item.GetString());
 59                        }
 60                    }
 061                    addressPrefixes = array;
 062                    continue;
 63                }
 064                if (property.NameEquals("nextHopIpAddress"))
 65                {
 066                    if (property.Value.ValueKind == JsonValueKind.Null)
 67                    {
 68                        continue;
 69                    }
 070                    nextHopIpAddress = property.Value.GetString();
 71                    continue;
 72                }
 73            }
 074            return new VirtualHubRoute(addressPrefixes, nextHopIpAddress);
 75        }
 76    }
 77}