< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_LocalAddress()-0%100%
get_Network()-0%100%
get_NextHop()-0%100%
get_SourcePeer()-0%100%
get_Origin()-0%100%
get_AsPath()-0%100%
get_Weight()-0%100%
DeserializeGatewayRoute(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\GatewayRoute.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
 8namespace Azure.ResourceManager.Network.Models
 9{
 10    /// <summary> Gateway routing details. </summary>
 11    public partial class GatewayRoute
 12    {
 13        /// <summary> Initializes a new instance of GatewayRoute. </summary>
 014        internal GatewayRoute()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of GatewayRoute. </summary>
 19        /// <param name="localAddress"> The gateway&apos;s local address. </param>
 20        /// <param name="network"> The route&apos;s network prefix. </param>
 21        /// <param name="nextHop"> The route&apos;s next hop. </param>
 22        /// <param name="sourcePeer"> The peer this route was learned from. </param>
 23        /// <param name="origin"> The source this route was learned from. </param>
 24        /// <param name="asPath"> The route&apos;s AS path sequence. </param>
 25        /// <param name="weight"> The route&apos;s weight. </param>
 026        internal GatewayRoute(string localAddress, string network, string nextHop, string sourcePeer, string origin, str
 27        {
 028            LocalAddress = localAddress;
 029            Network = network;
 030            NextHop = nextHop;
 031            SourcePeer = sourcePeer;
 032            Origin = origin;
 033            AsPath = asPath;
 034            Weight = weight;
 035        }
 36
 37        /// <summary> The gateway&apos;s local address. </summary>
 038        public string LocalAddress { get; }
 39        /// <summary> The route&apos;s network prefix. </summary>
 040        public string Network { get; }
 41        /// <summary> The route&apos;s next hop. </summary>
 042        public string NextHop { get; }
 43        /// <summary> The peer this route was learned from. </summary>
 044        public string SourcePeer { get; }
 45        /// <summary> The source this route was learned from. </summary>
 046        public string Origin { get; }
 47        /// <summary> The route&apos;s AS path sequence. </summary>
 048        public string AsPath { get; }
 49        /// <summary> The route&apos;s weight. </summary>
 050        public int? Weight { get; }
 51    }
 52}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\GatewayRoute.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 GatewayRoute
 14    {
 15        internal static GatewayRoute DeserializeGatewayRoute(JsonElement element)
 16        {
 017            string localAddress = default;
 018            string network = default;
 019            string nextHop = default;
 020            string sourcePeer = default;
 021            string origin = default;
 022            string asPath = default;
 023            int? weight = default;
 024            foreach (var property in element.EnumerateObject())
 25            {
 026                if (property.NameEquals("localAddress"))
 27                {
 028                    if (property.Value.ValueKind == JsonValueKind.Null)
 29                    {
 30                        continue;
 31                    }
 032                    localAddress = property.Value.GetString();
 033                    continue;
 34                }
 035                if (property.NameEquals("network"))
 36                {
 037                    if (property.Value.ValueKind == JsonValueKind.Null)
 38                    {
 39                        continue;
 40                    }
 041                    network = property.Value.GetString();
 042                    continue;
 43                }
 044                if (property.NameEquals("nextHop"))
 45                {
 046                    if (property.Value.ValueKind == JsonValueKind.Null)
 47                    {
 48                        continue;
 49                    }
 050                    nextHop = property.Value.GetString();
 051                    continue;
 52                }
 053                if (property.NameEquals("sourcePeer"))
 54                {
 055                    if (property.Value.ValueKind == JsonValueKind.Null)
 56                    {
 57                        continue;
 58                    }
 059                    sourcePeer = property.Value.GetString();
 060                    continue;
 61                }
 062                if (property.NameEquals("origin"))
 63                {
 064                    if (property.Value.ValueKind == JsonValueKind.Null)
 65                    {
 66                        continue;
 67                    }
 068                    origin = property.Value.GetString();
 069                    continue;
 70                }
 071                if (property.NameEquals("asPath"))
 72                {
 073                    if (property.Value.ValueKind == JsonValueKind.Null)
 74                    {
 75                        continue;
 76                    }
 077                    asPath = property.Value.GetString();
 078                    continue;
 79                }
 080                if (property.NameEquals("weight"))
 81                {
 082                    if (property.Value.ValueKind == JsonValueKind.Null)
 83                    {
 84                        continue;
 85                    }
 086                    weight = property.Value.GetInt32();
 87                    continue;
 88                }
 89            }
 090            return new GatewayRoute(localAddress, network, nextHop, sourcePeer, origin, asPath, weight);
 91        }
 92    }
 93}