< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\StaticRoute.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> List of all Static Routes. </summary>
 13    public partial class StaticRoute
 14    {
 15        /// <summary> Initializes a new instance of StaticRoute. </summary>
 016        public StaticRoute()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of StaticRoute. </summary>
 21        /// <param name="name"> The name of the StaticRoute that is unique within a VnetRoute. </param>
 22        /// <param name="addressPrefixes"> List of all address prefixes. </param>
 23        /// <param name="nextHopIpAddress"> The ip address of the next hop. </param>
 024        internal StaticRoute(string name, IList<string> addressPrefixes, string nextHopIpAddress)
 25        {
 026            Name = name;
 027            AddressPrefixes = addressPrefixes;
 028            NextHopIpAddress = nextHopIpAddress;
 029        }
 30
 31        /// <summary> The name of the StaticRoute that is unique within a VnetRoute. </summary>
 032        public string Name { get; set; }
 33        /// <summary> List of all address prefixes. </summary>
 034        public IList<string> AddressPrefixes { get; set; }
 35        /// <summary> The ip address of the next hop. </summary>
 036        public string NextHopIpAddress { get; set; }
 37    }
 38}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\StaticRoute.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 StaticRoute : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Name != null)
 20            {
 021                writer.WritePropertyName("name");
 022                writer.WriteStringValue(Name);
 23            }
 024            if (AddressPrefixes != null)
 25            {
 026                writer.WritePropertyName("addressPrefixes");
 027                writer.WriteStartArray();
 028                foreach (var item in AddressPrefixes)
 29                {
 030                    writer.WriteStringValue(item);
 31                }
 032                writer.WriteEndArray();
 33            }
 034            if (NextHopIpAddress != null)
 35            {
 036                writer.WritePropertyName("nextHopIpAddress");
 037                writer.WriteStringValue(NextHopIpAddress);
 38            }
 039            writer.WriteEndObject();
 040        }
 41
 42        internal static StaticRoute DeserializeStaticRoute(JsonElement element)
 43        {
 044            string name = default;
 045            IList<string> addressPrefixes = default;
 046            string nextHopIpAddress = default;
 047            foreach (var property in element.EnumerateObject())
 48            {
 049                if (property.NameEquals("name"))
 50                {
 051                    if (property.Value.ValueKind == JsonValueKind.Null)
 52                    {
 53                        continue;
 54                    }
 055                    name = property.Value.GetString();
 056                    continue;
 57                }
 058                if (property.NameEquals("addressPrefixes"))
 59                {
 060                    if (property.Value.ValueKind == JsonValueKind.Null)
 61                    {
 62                        continue;
 63                    }
 064                    List<string> array = new List<string>();
 065                    foreach (var item in property.Value.EnumerateArray())
 66                    {
 067                        if (item.ValueKind == JsonValueKind.Null)
 68                        {
 069                            array.Add(null);
 70                        }
 71                        else
 72                        {
 073                            array.Add(item.GetString());
 74                        }
 75                    }
 076                    addressPrefixes = array;
 077                    continue;
 78                }
 079                if (property.NameEquals("nextHopIpAddress"))
 80                {
 081                    if (property.Value.ValueKind == JsonValueKind.Null)
 82                    {
 83                        continue;
 84                    }
 085                    nextHopIpAddress = property.Value.GetString();
 86                    continue;
 87                }
 88            }
 089            return new StaticRoute(name, addressPrefixes, nextHopIpAddress);
 90        }
 91    }
 92}