< Summary

Class:Azure.ResourceManager.Network.Models.IPAddressAvailabilityResult
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\IPAddressAvailabilityResult.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\IPAddressAvailabilityResult.Serialization.cs
Covered lines:21
Uncovered lines:3
Coverable lines:24
Total lines:90
Line coverage:87.5% (21 of 24)
Covered branches:13
Total branches:14
Branch coverage:92.8% (13 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Available()-100%100%
get_AvailableIPAddresses()-100%100%
DeserializeIPAddressAvailabilityResult(...)-93.75%92.86%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\IPAddressAvailabilityResult.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> Response for CheckIPAddressAvailability API service call. </summary>
 13    public partial class IPAddressAvailabilityResult
 14    {
 15        /// <summary> Initializes a new instance of IPAddressAvailabilityResult. </summary>
 016        internal IPAddressAvailabilityResult()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of IPAddressAvailabilityResult. </summary>
 21        /// <param name="available"> Private IP address availability. </param>
 22        /// <param name="availableIPAddresses"> Contains other available private IP addresses if the asked for address i
 823        internal IPAddressAvailabilityResult(bool? available, IReadOnlyList<string> availableIPAddresses)
 24        {
 825            Available = available;
 826            AvailableIPAddresses = availableIPAddresses;
 827        }
 28
 29        /// <summary> Private IP address availability. </summary>
 830        public bool? Available { get; }
 31        /// <summary> Contains other available private IP addresses if the asked for address is taken. </summary>
 832        public IReadOnlyList<string> AvailableIPAddresses { get; }
 33    }
 34}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\IPAddressAvailabilityResult.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 IPAddressAvailabilityResult
 15    {
 16        internal static IPAddressAvailabilityResult DeserializeIPAddressAvailabilityResult(JsonElement element)
 17        {
 818            bool? available = default;
 819            IReadOnlyList<string> availableIPAddresses = default;
 6420            foreach (var property in element.EnumerateObject())
 21            {
 2422                if (property.NameEquals("available"))
 23                {
 824                    if (property.Value.ValueKind == JsonValueKind.Null)
 25                    {
 26                        continue;
 27                    }
 828                    available = property.Value.GetBoolean();
 829                    continue;
 30                }
 1631                if (property.NameEquals("availableIPAddresses"))
 32                {
 433                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 437                    List<string> array = new List<string>();
 4838                    foreach (var item in property.Value.EnumerateArray())
 39                    {
 2040                        if (item.ValueKind == JsonValueKind.Null)
 41                        {
 042                            array.Add(null);
 43                        }
 44                        else
 45                        {
 2046                            array.Add(item.GetString());
 47                        }
 48                    }
 449                    availableIPAddresses = array;
 50                    continue;
 51                }
 52            }
 853            return new IPAddressAvailabilityResult(available, availableIPAddresses);
 54        }
 55    }
 56}