< Summary

Class:Azure.ResourceManager.Network.Models.RouteTable
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\RouteTable.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\RouteTable.Serialization.cs
Covered lines:107
Uncovered lines:21
Coverable lines:128
Total lines:293
Line coverage:83.5% (107 of 128)
Covered branches:70
Total branches:84
Branch coverage:83.3% (70 of 84)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Etag()-100%100%
get_Routes()-100%100%
get_Subnets()-100%100%
get_DisableBgpRoutePropagation()-100%100%
get_ProvisioningState()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-76.09%76.92%
DeserializeRouteTable(...)-85.29%86.21%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\RouteTable.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> Route table resource. </summary>
 13    public partial class RouteTable : Resource
 14    {
 15        /// <summary> Initializes a new instance of RouteTable. </summary>
 2416        public RouteTable()
 17        {
 2418        }
 19
 20        /// <summary> Initializes a new instance of RouteTable. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> Resource name. </param>
 23        /// <param name="type"> Resource type. </param>
 24        /// <param name="location"> Resource location. </param>
 25        /// <param name="tags"> Resource tags. </param>
 26        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 27        /// <param name="routes"> Collection of routes contained within a route table. </param>
 28        /// <param name="subnets"> A collection of references to subnets. </param>
 29        /// <param name="disableBgpRoutePropagation"> Whether to disable the routes learned by BGP on that route table. 
 30        /// <param name="provisioningState"> The provisioning state of the route table resource. </param>
 7631        internal RouteTable(string id, string name, string type, string location, IDictionary<string, string> tags, stri
 32        {
 7633            Etag = etag;
 7634            Routes = routes;
 7635            Subnets = subnets;
 7636            DisableBgpRoutePropagation = disableBgpRoutePropagation;
 7637            ProvisioningState = provisioningState;
 7638        }
 39
 40        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 8041        public string Etag { get; }
 42        /// <summary> Collection of routes contained within a route table. </summary>
 40043        public IList<Route> Routes { get; set; }
 44        /// <summary> A collection of references to subnets. </summary>
 7645        public IList<Subnet> Subnets { get; }
 46        /// <summary> Whether to disable the routes learned by BGP on that route table. True means disable. </summary>
 15647        public bool? DisableBgpRoutePropagation { get; set; }
 48        /// <summary> The provisioning state of the route table resource. </summary>
 10049        public ProvisioningState? ProvisioningState { get; }
 50    }
 51}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\RouteTable.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 RouteTable : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 6418            writer.WriteStartObject();
 6419            if (Etag != null)
 20            {
 1621                writer.WritePropertyName("etag");
 1622                writer.WriteStringValue(Etag);
 23            }
 6424            if (Id != null)
 25            {
 2426                writer.WritePropertyName("id");
 2427                writer.WriteStringValue(Id);
 28            }
 6429            if (Name != null)
 30            {
 1631                writer.WritePropertyName("name");
 1632                writer.WriteStringValue(Name);
 33            }
 6434            if (Type != null)
 35            {
 1636                writer.WritePropertyName("type");
 1637                writer.WriteStringValue(Type);
 38            }
 6439            if (Location != null)
 40            {
 5641                writer.WritePropertyName("location");
 5642                writer.WriteStringValue(Location);
 43            }
 6444            if (Tags != null)
 45            {
 046                writer.WritePropertyName("tags");
 047                writer.WriteStartObject();
 048                foreach (var item in Tags)
 49                {
 050                    writer.WritePropertyName(item.Key);
 051                    writer.WriteStringValue(item.Value);
 52                }
 053                writer.WriteEndObject();
 54            }
 6455            writer.WritePropertyName("properties");
 6456            writer.WriteStartObject();
 6457            if (Routes != null)
 58            {
 4859                writer.WritePropertyName("routes");
 4860                writer.WriteStartArray();
 20861                foreach (var item in Routes)
 62                {
 5663                    writer.WriteObjectValue(item);
 64                }
 4865                writer.WriteEndArray();
 66            }
 6467            if (Subnets != null)
 68            {
 069                writer.WritePropertyName("subnets");
 070                writer.WriteStartArray();
 071                foreach (var item in Subnets)
 72                {
 073                    writer.WriteObjectValue(item);
 74                }
 075                writer.WriteEndArray();
 76            }
 6477            if (DisableBgpRoutePropagation != null)
 78            {
 1679                writer.WritePropertyName("disableBgpRoutePropagation");
 1680                writer.WriteBooleanValue(DisableBgpRoutePropagation.Value);
 81            }
 6482            if (ProvisioningState != null)
 83            {
 1684                writer.WritePropertyName("provisioningState");
 1685                writer.WriteStringValue(ProvisioningState.Value.ToString());
 86            }
 6487            writer.WriteEndObject();
 6488            writer.WriteEndObject();
 6489        }
 90
 91        internal static RouteTable DeserializeRouteTable(JsonElement element)
 92        {
 7693            string etag = default;
 7694            string id = default;
 7695            string name = default;
 7696            string type = default;
 7697            string location = default;
 7698            IDictionary<string, string> tags = default;
 7699            IList<Route> routes = default;
 76100            IList<Subnet> subnets = default;
 76101            bool? disableBgpRoutePropagation = default;
 76102            ProvisioningState? provisioningState = default;
 984103            foreach (var property in element.EnumerateObject())
 104            {
 416105                if (property.NameEquals("etag"))
 106                {
 68107                    if (property.Value.ValueKind == JsonValueKind.Null)
 108                    {
 109                        continue;
 110                    }
 68111                    etag = property.Value.GetString();
 68112                    continue;
 113                }
 348114                if (property.NameEquals("id"))
 115                {
 76116                    if (property.Value.ValueKind == JsonValueKind.Null)
 117                    {
 118                        continue;
 119                    }
 76120                    id = property.Value.GetString();
 76121                    continue;
 122                }
 272123                if (property.NameEquals("name"))
 124                {
 68125                    if (property.Value.ValueKind == JsonValueKind.Null)
 126                    {
 127                        continue;
 128                    }
 68129                    name = property.Value.GetString();
 68130                    continue;
 131                }
 204132                if (property.NameEquals("type"))
 133                {
 68134                    if (property.Value.ValueKind == JsonValueKind.Null)
 135                    {
 136                        continue;
 137                    }
 68138                    type = property.Value.GetString();
 68139                    continue;
 140                }
 136141                if (property.NameEquals("location"))
 142                {
 68143                    if (property.Value.ValueKind == JsonValueKind.Null)
 144                    {
 145                        continue;
 146                    }
 68147                    location = property.Value.GetString();
 68148                    continue;
 149                }
 68150                if (property.NameEquals("tags"))
 151                {
 0152                    if (property.Value.ValueKind == JsonValueKind.Null)
 153                    {
 154                        continue;
 155                    }
 0156                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0157                    foreach (var property0 in property.Value.EnumerateObject())
 158                    {
 0159                        if (property0.Value.ValueKind == JsonValueKind.Null)
 160                        {
 0161                            dictionary.Add(property0.Name, null);
 162                        }
 163                        else
 164                        {
 0165                            dictionary.Add(property0.Name, property0.Value.GetString());
 166                        }
 167                    }
 0168                    tags = dictionary;
 0169                    continue;
 170                }
 68171                if (property.NameEquals("properties"))
 172                {
 696173                    foreach (var property0 in property.Value.EnumerateObject())
 174                    {
 280175                        if (property0.NameEquals("routes"))
 176                        {
 68177                            if (property0.Value.ValueKind == JsonValueKind.Null)
 178                            {
 179                                continue;
 180                            }
 68181                            List<Route> array = new List<Route>();
 288182                            foreach (var item in property0.Value.EnumerateArray())
 183                            {
 76184                                if (item.ValueKind == JsonValueKind.Null)
 185                                {
 0186                                    array.Add(null);
 187                                }
 188                                else
 189                                {
 76190                                    array.Add(Route.DeserializeRoute(item));
 191                                }
 192                            }
 68193                            routes = array;
 68194                            continue;
 195                        }
 212196                        if (property0.NameEquals("subnets"))
 197                        {
 8198                            if (property0.Value.ValueKind == JsonValueKind.Null)
 199                            {
 200                                continue;
 201                            }
 8202                            List<Subnet> array = new List<Subnet>();
 32203                            foreach (var item in property0.Value.EnumerateArray())
 204                            {
 8205                                if (item.ValueKind == JsonValueKind.Null)
 206                                {
 0207                                    array.Add(null);
 208                                }
 209                                else
 210                                {
 8211                                    array.Add(Subnet.DeserializeSubnet(item));
 212                                }
 213                            }
 8214                            subnets = array;
 8215                            continue;
 216                        }
 204217                        if (property0.NameEquals("disableBgpRoutePropagation"))
 218                        {
 68219                            if (property0.Value.ValueKind == JsonValueKind.Null)
 220                            {
 221                                continue;
 222                            }
 68223                            disableBgpRoutePropagation = property0.Value.GetBoolean();
 68224                            continue;
 225                        }
 136226                        if (property0.NameEquals("provisioningState"))
 227                        {
 68228                            if (property0.Value.ValueKind == JsonValueKind.Null)
 229                            {
 230                                continue;
 231                            }
 68232                            provisioningState = new ProvisioningState(property0.Value.GetString());
 233                            continue;
 234                        }
 235                    }
 236                    continue;
 237                }
 238            }
 76239            return new RouteTable(id, name, type, location, tags, etag, routes, subnets, disableBgpRoutePropagation, pro
 240        }
 241    }
 242}