< Summary

Class:Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetNetworkConfiguration
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetNetworkConfiguration.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetNetworkConfiguration.Serialization.cs
Covered lines:91
Uncovered lines:9
Coverable lines:100
Total lines:233
Line coverage:91% (91 of 100)
Covered branches:52
Total branches:58
Branch coverage:89.6% (52 of 58)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-80%50%
.ctor(...)-100%100%
get_Name()-100%100%
get_Primary()-100%100%
get_EnableAcceleratedNetworking()-100%100%
get_NetworkSecurityGroup()-100%100%
get_DnsSettings()-100%100%
get_IpConfigurations()-100%100%
get_EnableIPForwarding()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-87.5%87.5%
DeserializeVirtualMachineScaleSetNetworkConfiguration(...)-91.49%92.5%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetNetworkConfiguration.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;
 9using System.Collections.Generic;
 10
 11namespace Azure.ResourceManager.Compute.Models
 12{
 13    /// <summary> Describes a virtual machine scale set network profile&apos;s network configurations. </summary>
 14    public partial class VirtualMachineScaleSetNetworkConfiguration : SubResource
 15    {
 16        /// <summary> Initializes a new instance of VirtualMachineScaleSetNetworkConfiguration. </summary>
 17        /// <param name="name"> The network configuration name. </param>
 16018        public VirtualMachineScaleSetNetworkConfiguration(string name)
 19        {
 16020            if (name == null)
 21            {
 022                throw new ArgumentNullException(nameof(name));
 23            }
 24
 16025            Name = name;
 16026        }
 27
 28        /// <summary> Initializes a new instance of VirtualMachineScaleSetNetworkConfiguration. </summary>
 29        /// <param name="id"> Resource Id. </param>
 30        /// <param name="name"> The network configuration name. </param>
 31        /// <param name="primary"> Specifies the primary network interface in case the virtual machine has more than 1 n
 32        /// <param name="enableAcceleratedNetworking"> Specifies whether the network interface is accelerated networking
 33        /// <param name="networkSecurityGroup"> The network security group. </param>
 34        /// <param name="dnsSettings"> The dns settings to be applied on the network interfaces. </param>
 35        /// <param name="ipConfigurations"> Specifies the IP configurations of the network interface. </param>
 36        /// <param name="enableIPForwarding"> Whether IP forwarding enabled on this NIC. </param>
 53637        internal VirtualMachineScaleSetNetworkConfiguration(string id, string name, bool? primary, bool? enableAccelerat
 38        {
 53639            Name = name;
 53640            Primary = primary;
 53641            EnableAcceleratedNetworking = enableAcceleratedNetworking;
 53642            NetworkSecurityGroup = networkSecurityGroup;
 53643            DnsSettings = dnsSettings;
 53644            IpConfigurations = ipConfigurations;
 53645            EnableIPForwarding = enableIPForwarding;
 53646        }
 47
 48        /// <summary> The network configuration name. </summary>
 162849        public string Name { get; set; }
 50        /// <summary> Specifies the primary network interface in case the virtual machine has more than 1 network interf
 142451        public bool? Primary { get; set; }
 52        /// <summary> Specifies whether the network interface is accelerated networking-enabled. </summary>
 91653        public bool? EnableAcceleratedNetworking { get; set; }
 54        /// <summary> The network security group. </summary>
 92055        public SubResource NetworkSecurityGroup { get; set; }
 56        /// <summary> The dns settings to be applied on the network interfaces. </summary>
 92457        public VirtualMachineScaleSetNetworkConfigurationDnsSettings DnsSettings { get; set; }
 58        /// <summary> Specifies the IP configurations of the network interface. </summary>
 350459        public IList<VirtualMachineScaleSetIPConfiguration> IpConfigurations { get; set; }
 60        /// <summary> Whether IP forwarding enabled on this NIC. </summary>
 90061        public bool? EnableIPForwarding { get; set; }
 62    }
 63}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetNetworkConfiguration.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.Compute.Models
 13{
 14    public partial class VirtualMachineScaleSetNetworkConfiguration : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 36418            writer.WriteStartObject();
 36419            writer.WritePropertyName("name");
 36420            writer.WriteStringValue(Name);
 36421            if (Id != null)
 22            {
 023                writer.WritePropertyName("id");
 024                writer.WriteStringValue(Id);
 25            }
 36426            writer.WritePropertyName("properties");
 36427            writer.WriteStartObject();
 36428            if (Primary != null)
 29            {
 36430                writer.WritePropertyName("primary");
 36431                writer.WriteBooleanValue(Primary.Value);
 32            }
 36433            if (EnableAcceleratedNetworking != null)
 34            {
 835                writer.WritePropertyName("enableAcceleratedNetworking");
 836                writer.WriteBooleanValue(EnableAcceleratedNetworking.Value);
 37            }
 36438            if (NetworkSecurityGroup != null)
 39            {
 840                writer.WritePropertyName("networkSecurityGroup");
 841                writer.WriteObjectValue(NetworkSecurityGroup);
 42            }
 36443            if (DnsSettings != null)
 44            {
 845                writer.WritePropertyName("dnsSettings");
 846                writer.WriteObjectValue(DnsSettings);
 47            }
 36448            if (IpConfigurations != null)
 49            {
 36450                writer.WritePropertyName("ipConfigurations");
 36451                writer.WriteStartArray();
 148852                foreach (var item in IpConfigurations)
 53                {
 38054                    writer.WriteObjectValue(item);
 55                }
 36456                writer.WriteEndArray();
 57            }
 36458            if (EnableIPForwarding != null)
 59            {
 060                writer.WritePropertyName("enableIPForwarding");
 061                writer.WriteBooleanValue(EnableIPForwarding.Value);
 62            }
 36463            writer.WriteEndObject();
 36464            writer.WriteEndObject();
 36465        }
 66
 67        internal static VirtualMachineScaleSetNetworkConfiguration DeserializeVirtualMachineScaleSetNetworkConfiguration
 68        {
 53669            string name = default;
 53670            string id = default;
 53671            bool? primary = default;
 53672            bool? enableAcceleratedNetworking = default;
 53673            SubResource networkSecurityGroup = default;
 53674            VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings = default;
 53675            IList<VirtualMachineScaleSetIPConfiguration> ipConfigurations = default;
 53676            bool? enableIPForwarding = default;
 321677            foreach (var property in element.EnumerateObject())
 78            {
 107279                if (property.NameEquals("name"))
 80                {
 53681                    name = property.Value.GetString();
 53682                    continue;
 83                }
 53684                if (property.NameEquals("id"))
 85                {
 086                    if (property.Value.ValueKind == JsonValueKind.Null)
 87                    {
 88                        continue;
 89                    }
 090                    id = property.Value.GetString();
 091                    continue;
 92                }
 53693                if (property.NameEquals("properties"))
 94                {
 645695                    foreach (var property0 in property.Value.EnumerateObject())
 96                    {
 269297                        if (property0.NameEquals("primary"))
 98                        {
 53699                            if (property0.Value.ValueKind == JsonValueKind.Null)
 100                            {
 101                                continue;
 102                            }
 536103                            primary = property0.Value.GetBoolean();
 536104                            continue;
 105                        }
 2156106                        if (property0.NameEquals("enableAcceleratedNetworking"))
 107                        {
 536108                            if (property0.Value.ValueKind == JsonValueKind.Null)
 109                            {
 110                                continue;
 111                            }
 536112                            enableAcceleratedNetworking = property0.Value.GetBoolean();
 536113                            continue;
 114                        }
 1620115                        if (property0.NameEquals("networkSecurityGroup"))
 116                        {
 12117                            if (property0.Value.ValueKind == JsonValueKind.Null)
 118                            {
 119                                continue;
 120                            }
 12121                            networkSecurityGroup = DeserializeSubResource(property0.Value);
 12122                            continue;
 123                        }
 1608124                        if (property0.NameEquals("dnsSettings"))
 125                        {
 536126                            if (property0.Value.ValueKind == JsonValueKind.Null)
 127                            {
 128                                continue;
 129                            }
 536130                            dnsSettings = VirtualMachineScaleSetNetworkConfigurationDnsSettings.DeserializeVirtualMachin
 536131                            continue;
 132                        }
 1072133                        if (property0.NameEquals("ipConfigurations"))
 134                        {
 536135                            if (property0.Value.ValueKind == JsonValueKind.Null)
 136                            {
 137                                continue;
 138                            }
 536139                            List<VirtualMachineScaleSetIPConfiguration> array = new List<VirtualMachineScaleSetIPConfigu
 2192140                            foreach (var item in property0.Value.EnumerateArray())
 141                            {
 560142                                if (item.ValueKind == JsonValueKind.Null)
 143                                {
 0144                                    array.Add(null);
 145                                }
 146                                else
 147                                {
 560148                                    array.Add(VirtualMachineScaleSetIPConfiguration.DeserializeVirtualMachineScaleSetIPC
 149                                }
 150                            }
 536151                            ipConfigurations = array;
 536152                            continue;
 153                        }
 536154                        if (property0.NameEquals("enableIPForwarding"))
 155                        {
 536156                            if (property0.Value.ValueKind == JsonValueKind.Null)
 157                            {
 158                                continue;
 159                            }
 536160                            enableIPForwarding = property0.Value.GetBoolean();
 161                            continue;
 162                        }
 163                    }
 164                    continue;
 165                }
 166            }
 536167            return new VirtualMachineScaleSetNetworkConfiguration(id, name, primary, enableAcceleratedNetworking, networ
 168        }
 169    }
 170}