< Summary

Class:Azure.ResourceManager.Network.Models.NetworkInterfaceDnsSettings
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkInterfaceDnsSettings.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkInterfaceDnsSettings.Serialization.cs
Covered lines:68
Uncovered lines:6
Coverable lines:74
Total lines:185
Line coverage:91.8% (68 of 74)
Covered branches:40
Total branches:44
Branch coverage:90.9% (40 of 44)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_DnsServers()-100%100%
get_AppliedDnsServers()-100%100%
get_InternalDnsNameLabel()-100%100%
get_InternalFqdn()-100%100%
get_InternalDomainNameSuffix()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-83.33%85.71%
DeserializeNetworkInterfaceDnsSettings(...)-94.44%93.33%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkInterfaceDnsSettings.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> DNS settings of a network interface. </summary>
 13    public partial class NetworkInterfaceDnsSettings
 14    {
 15        /// <summary> Initializes a new instance of NetworkInterfaceDnsSettings. </summary>
 816        public NetworkInterfaceDnsSettings()
 17        {
 818        }
 19
 20        /// <summary> Initializes a new instance of NetworkInterfaceDnsSettings. </summary>
 21        /// <param name="dnsServers"> List of DNS servers IP addresses. Use &apos;AzureProvidedDNS&apos; to switch to az
 22        /// <param name="appliedDnsServers"> If the VM that uses this NIC is part of an Availability Set, then this list
 23        /// <param name="internalDnsNameLabel"> Relative DNS name for this NIC used for internal communications between 
 24        /// <param name="internalFqdn"> Fully qualified DNS name supporting internal communications between VMs in the s
 25        /// <param name="internalDomainNameSuffix"> Even if internalDnsNameLabel is not specified, a DNS entry is create
 25226        internal NetworkInterfaceDnsSettings(IList<string> dnsServers, IList<string> appliedDnsServers, string internalD
 27        {
 25228            DnsServers = dnsServers;
 25229            AppliedDnsServers = appliedDnsServers;
 25230            InternalDnsNameLabel = internalDnsNameLabel;
 25231            InternalFqdn = internalFqdn;
 25232            InternalDomainNameSuffix = internalDomainNameSuffix;
 25233        }
 34
 35        /// <summary> List of DNS servers IP addresses. Use &apos;AzureProvidedDNS&apos; to switch to azure provided DNS
 47636        public IList<string> DnsServers { get; set; }
 37        /// <summary> If the VM that uses this NIC is part of an Availability Set, then this list will have the union of
 13638        public IList<string> AppliedDnsServers { get; }
 39        /// <summary> Relative DNS name for this NIC used for internal communications between VMs in the same virtual ne
 35640        public string InternalDnsNameLabel { get; set; }
 41        /// <summary> Fully qualified DNS name supporting internal communications between VMs in the same virtual networ
 8042        public string InternalFqdn { get; }
 43        /// <summary> Even if internalDnsNameLabel is not specified, a DNS entry is created for the primary NIC of the V
 13244        public string InternalDomainNameSuffix { get; }
 45    }
 46}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkInterfaceDnsSettings.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 NetworkInterfaceDnsSettings : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 7218            writer.WriteStartObject();
 7219            if (DnsServers != null)
 20            {
 7221                writer.WritePropertyName("dnsServers");
 7222                writer.WriteStartArray();
 20823                foreach (var item in DnsServers)
 24                {
 3225                    writer.WriteStringValue(item);
 26                }
 7227                writer.WriteEndArray();
 28            }
 7229            if (AppliedDnsServers != null)
 30            {
 5631                writer.WritePropertyName("appliedDnsServers");
 5632                writer.WriteStartArray();
 033                foreach (var item in AppliedDnsServers)
 34                {
 035                    writer.WriteStringValue(item);
 36                }
 5637                writer.WriteEndArray();
 38            }
 7239            if (InternalDnsNameLabel != null)
 40            {
 1641                writer.WritePropertyName("internalDnsNameLabel");
 1642                writer.WriteStringValue(InternalDnsNameLabel);
 43            }
 7244            if (InternalFqdn != null)
 45            {
 046                writer.WritePropertyName("internalFqdn");
 047                writer.WriteStringValue(InternalFqdn);
 48            }
 7249            if (InternalDomainNameSuffix != null)
 50            {
 5651                writer.WritePropertyName("internalDomainNameSuffix");
 5652                writer.WriteStringValue(InternalDomainNameSuffix);
 53            }
 7254            writer.WriteEndObject();
 7255        }
 56
 57        internal static NetworkInterfaceDnsSettings DeserializeNetworkInterfaceDnsSettings(JsonElement element)
 58        {
 25259            IList<string> dnsServers = default;
 25260            IList<string> appliedDnsServers = default;
 25261            string internalDnsNameLabel = default;
 25262            string internalFqdn = default;
 25263            string internalDomainNameSuffix = default;
 206464            foreach (var property in element.EnumerateObject())
 65            {
 78066                if (property.NameEquals("dnsServers"))
 67                {
 25268                    if (property.Value.ValueKind == JsonValueKind.Null)
 69                    {
 70                        continue;
 71                    }
 25272                    List<string> array = new List<string>();
 61673                    foreach (var item in property.Value.EnumerateArray())
 74                    {
 5675                        if (item.ValueKind == JsonValueKind.Null)
 76                        {
 077                            array.Add(null);
 78                        }
 79                        else
 80                        {
 5681                            array.Add(item.GetString());
 82                        }
 83                    }
 25284                    dnsServers = array;
 25285                    continue;
 86                }
 52887                if (property.NameEquals("appliedDnsServers"))
 88                {
 25289                    if (property.Value.ValueKind == JsonValueKind.Null)
 90                    {
 91                        continue;
 92                    }
 25293                    List<string> array = new List<string>();
 53694                    foreach (var item in property.Value.EnumerateArray())
 95                    {
 1696                        if (item.ValueKind == JsonValueKind.Null)
 97                        {
 098                            array.Add(null);
 99                        }
 100                        else
 101                        {
 16102                            array.Add(item.GetString());
 103                        }
 104                    }
 252105                    appliedDnsServers = array;
 252106                    continue;
 107                }
 276108                if (property.NameEquals("internalDnsNameLabel"))
 109                {
 16110                    if (property.Value.ValueKind == JsonValueKind.Null)
 111                    {
 112                        continue;
 113                    }
 16114                    internalDnsNameLabel = property.Value.GetString();
 16115                    continue;
 116                }
 260117                if (property.NameEquals("internalFqdn"))
 118                {
 16119                    if (property.Value.ValueKind == JsonValueKind.Null)
 120                    {
 121                        continue;
 122                    }
 16123                    internalFqdn = property.Value.GetString();
 16124                    continue;
 125                }
 244126                if (property.NameEquals("internalDomainNameSuffix"))
 127                {
 244128                    if (property.Value.ValueKind == JsonValueKind.Null)
 129                    {
 130                        continue;
 131                    }
 244132                    internalDomainNameSuffix = property.Value.GetString();
 133                    continue;
 134                }
 135            }
 252136            return new NetworkInterfaceDnsSettings(dnsServers, appliedDnsServers, internalDnsNameLabel, internalFqdn, in
 137        }
 138    }
 139}