< Summary

Class:Azure.ResourceManager.Network.Models.AddressSpace
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\AddressSpace.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\AddressSpace.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_AddressPrefixes()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeAddressSpace(...)-90.91%90%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\AddressSpace.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> AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual network
 13    public partial class AddressSpace
 14    {
 15        /// <summary> Initializes a new instance of AddressSpace. </summary>
 12416        public AddressSpace()
 17        {
 12418        }
 19
 20        /// <summary> Initializes a new instance of AddressSpace. </summary>
 21        /// <param name="addressPrefixes"> A list of address blocks reserved for this virtual network in CIDR notation. 
 22422        internal AddressSpace(IList<string> addressPrefixes)
 23        {
 22424            AddressPrefixes = addressPrefixes;
 22425        }
 26
 27        /// <summary> A list of address blocks reserved for this virtual network in CIDR notation. </summary>
 98428        public IList<string> AddressPrefixes { get; set; }
 29    }
 30}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\AddressSpace.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 AddressSpace : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 30418            writer.WriteStartObject();
 30419            if (AddressPrefixes != null)
 20            {
 30421                writer.WritePropertyName("addressPrefixes");
 30422                writer.WriteStartArray();
 121623                foreach (var item in AddressPrefixes)
 24                {
 30425                    writer.WriteStringValue(item);
 26                }
 30427                writer.WriteEndArray();
 28            }
 30429            writer.WriteEndObject();
 30430        }
 31
 32        internal static AddressSpace DeserializeAddressSpace(JsonElement element)
 33        {
 22434            IList<string> addressPrefixes = default;
 89635            foreach (var property in element.EnumerateObject())
 36            {
 22437                if (property.NameEquals("addressPrefixes"))
 38                {
 22439                    if (property.Value.ValueKind == JsonValueKind.Null)
 40                    {
 41                        continue;
 42                    }
 22443                    List<string> array = new List<string>();
 89644                    foreach (var item in property.Value.EnumerateArray())
 45                    {
 22446                        if (item.ValueKind == JsonValueKind.Null)
 47                        {
 048                            array.Add(null);
 49                        }
 50                        else
 51                        {
 22452                            array.Add(item.GetString());
 53                        }
 54                    }
 22455                    addressPrefixes = array;
 56                    continue;
 57                }
 58            }
 22459            return new AddressSpace(addressPrefixes);
 60        }
 61    }
 62}