< Summary

Class:Azure.ResourceManager.Network.Models.DhcpOptions
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\DhcpOptions.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\DhcpOptions.Serialization.cs
Covered lines:25
Uncovered lines:1
Coverable lines:26
Total lines:92
Line coverage:96.1% (25 of 26)
Covered branches:13
Total branches:14
Branch coverage:92.8% (13 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_DnsServers()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeDhcpOptions(...)-90.91%90%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\DhcpOptions.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> DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standar
 13    public partial class DhcpOptions
 14    {
 15        /// <summary> Initializes a new instance of DhcpOptions. </summary>
 9616        public DhcpOptions()
 17        {
 9618        }
 19
 20        /// <summary> Initializes a new instance of DhcpOptions. </summary>
 21        /// <param name="dnsServers"> The list of DNS servers IP addresses. </param>
 14822        internal DhcpOptions(IList<string> dnsServers)
 23        {
 14824            DnsServers = dnsServers;
 14825        }
 26
 27        /// <summary> The list of DNS servers IP addresses. </summary>
 65228        public IList<string> DnsServers { get; set; }
 29    }
 30}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\DhcpOptions.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 DhcpOptions : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 20018            writer.WriteStartObject();
 20019            if (DnsServers != null)
 20            {
 20021                writer.WritePropertyName("dnsServers");
 20022                writer.WriteStartArray();
 120023                foreach (var item in DnsServers)
 24                {
 40025                    writer.WriteStringValue(item);
 26                }
 20027                writer.WriteEndArray();
 28            }
 20029            writer.WriteEndObject();
 20030        }
 31
 32        internal static DhcpOptions DeserializeDhcpOptions(JsonElement element)
 33        {
 14834            IList<string> dnsServers = default;
 59235            foreach (var property in element.EnumerateObject())
 36            {
 14837                if (property.NameEquals("dnsServers"))
 38                {
 14839                    if (property.Value.ValueKind == JsonValueKind.Null)
 40                    {
 41                        continue;
 42                    }
 14843                    List<string> array = new List<string>();
 88844                    foreach (var item in property.Value.EnumerateArray())
 45                    {
 29646                        if (item.ValueKind == JsonValueKind.Null)
 47                        {
 048                            array.Add(null);
 49                        }
 50                        else
 51                        {
 29652                            array.Add(item.GetString());
 53                        }
 54                    }
 14855                    dnsServers = array;
 56                    continue;
 57                }
 58            }
 14859            return new DhcpOptions(dnsServers);
 60        }
 61    }
 62}