< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Name()-100%100%
get_Tier()-100%100%
get_Capacity()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeVirtualNetworkGatewaySku(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualNetworkGatewaySku.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> VirtualNetworkGatewaySku details. </summary>
 11    public partial class VirtualNetworkGatewaySku
 12    {
 13        /// <summary> Initializes a new instance of VirtualNetworkGatewaySku. </summary>
 814        public VirtualNetworkGatewaySku()
 15        {
 816        }
 17
 18        /// <summary> Initializes a new instance of VirtualNetworkGatewaySku. </summary>
 19        /// <param name="name"> Gateway SKU name. </param>
 20        /// <param name="tier"> Gateway SKU tier. </param>
 21        /// <param name="capacity"> The capacity. </param>
 3222        internal VirtualNetworkGatewaySku(VirtualNetworkGatewaySkuName? name, VirtualNetworkGatewaySkuTier? tier, int? c
 23        {
 3224            Name = name;
 3225            Tier = tier;
 3226            Capacity = capacity;
 3227        }
 28
 29        /// <summary> Gateway SKU name. </summary>
 18430        public VirtualNetworkGatewaySkuName? Name { get; set; }
 31        /// <summary> Gateway SKU tier. </summary>
 18432        public VirtualNetworkGatewaySkuTier? Tier { get; set; }
 33        /// <summary> The capacity. </summary>
 12834        public int? Capacity { get; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualNetworkGatewaySku.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 VirtualNetworkGatewaySku : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 7217            writer.WriteStartObject();
 7218            if (Name != null)
 19            {
 7220                writer.WritePropertyName("name");
 7221                writer.WriteStringValue(Name.Value.ToString());
 22            }
 7223            if (Tier != null)
 24            {
 7225                writer.WritePropertyName("tier");
 7226                writer.WriteStringValue(Tier.Value.ToString());
 27            }
 7228            if (Capacity != null)
 29            {
 5630                writer.WritePropertyName("capacity");
 5631                writer.WriteNumberValue(Capacity.Value);
 32            }
 7233            writer.WriteEndObject();
 7234        }
 35
 36        internal static VirtualNetworkGatewaySku DeserializeVirtualNetworkGatewaySku(JsonElement element)
 37        {
 3238            VirtualNetworkGatewaySkuName? name = default;
 3239            VirtualNetworkGatewaySkuTier? tier = default;
 3240            int? capacity = default;
 25641            foreach (var property in element.EnumerateObject())
 42            {
 9643                if (property.NameEquals("name"))
 44                {
 3245                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 3249                    name = new VirtualNetworkGatewaySkuName(property.Value.GetString());
 3250                    continue;
 51                }
 6452                if (property.NameEquals("tier"))
 53                {
 3254                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 3258                    tier = new VirtualNetworkGatewaySkuTier(property.Value.GetString());
 3259                    continue;
 60                }
 3261                if (property.NameEquals("capacity"))
 62                {
 3263                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 3267                    capacity = property.Value.GetInt32();
 68                    continue;
 69                }
 70            }
 3271            return new VirtualNetworkGatewaySku(name, tier, capacity);
 72        }
 73    }
 74}