< Summary

Class:Azure.ResourceManager.Network.Models.VirtualNetworkUsage
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualNetworkUsage.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualNetworkUsage.Serialization.cs
Covered lines:34
Uncovered lines:6
Coverable lines:40
Total lines:117
Line coverage:85% (34 of 40)
Covered branches:22
Total branches:22
Branch coverage:100% (22 of 22)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_CurrentValue()-100%100%
get_Id()-0%100%
get_Limit()-0%100%
get_Name()-0%100%
get_Unit()-0%100%
DeserializeVirtualNetworkUsage(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualNetworkUsage.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
 8namespace Azure.ResourceManager.Network.Models
 9{
 10    /// <summary> Usage details for subnet. </summary>
 11    public partial class VirtualNetworkUsage
 12    {
 13        /// <summary> Initializes a new instance of VirtualNetworkUsage. </summary>
 014        internal VirtualNetworkUsage()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of VirtualNetworkUsage. </summary>
 19        /// <param name="currentValue"> Indicates number of IPs used from the Subnet. </param>
 20        /// <param name="id"> Subnet identifier. </param>
 21        /// <param name="limit"> Indicates the size of the subnet. </param>
 22        /// <param name="name"> The name containing common and localized value for usage. </param>
 23        /// <param name="unit"> Usage units. Returns &apos;Count&apos;. </param>
 824        internal VirtualNetworkUsage(double? currentValue, string id, double? limit, VirtualNetworkUsageName name, strin
 25        {
 826            CurrentValue = currentValue;
 827            Id = id;
 828            Limit = limit;
 829            Name = name;
 830            Unit = unit;
 831        }
 32
 33        /// <summary> Indicates number of IPs used from the Subnet. </summary>
 834        public double? CurrentValue { get; }
 35        /// <summary> Subnet identifier. </summary>
 036        public string Id { get; }
 37        /// <summary> Indicates the size of the subnet. </summary>
 038        public double? Limit { get; }
 39        /// <summary> The name containing common and localized value for usage. </summary>
 040        public VirtualNetworkUsageName Name { get; }
 41        /// <summary> Usage units. Returns &apos;Count&apos;. </summary>
 042        public string Unit { get; }
 43    }
 44}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualNetworkUsage.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Network.Models
 12{
 13    public partial class VirtualNetworkUsage
 14    {
 15        internal static VirtualNetworkUsage DeserializeVirtualNetworkUsage(JsonElement element)
 16        {
 817            double? currentValue = default;
 818            string id = default;
 819            double? limit = default;
 820            VirtualNetworkUsageName name = default;
 821            string unit = default;
 9622            foreach (var property in element.EnumerateObject())
 23            {
 4024                if (property.NameEquals("currentValue"))
 25                {
 826                    if (property.Value.ValueKind == JsonValueKind.Null)
 27                    {
 28                        continue;
 29                    }
 830                    currentValue = property.Value.GetDouble();
 831                    continue;
 32                }
 3233                if (property.NameEquals("id"))
 34                {
 835                    if (property.Value.ValueKind == JsonValueKind.Null)
 36                    {
 37                        continue;
 38                    }
 839                    id = property.Value.GetString();
 840                    continue;
 41                }
 2442                if (property.NameEquals("limit"))
 43                {
 844                    if (property.Value.ValueKind == JsonValueKind.Null)
 45                    {
 46                        continue;
 47                    }
 848                    limit = property.Value.GetDouble();
 849                    continue;
 50                }
 1651                if (property.NameEquals("name"))
 52                {
 853                    if (property.Value.ValueKind == JsonValueKind.Null)
 54                    {
 55                        continue;
 56                    }
 857                    name = VirtualNetworkUsageName.DeserializeVirtualNetworkUsageName(property.Value);
 858                    continue;
 59                }
 860                if (property.NameEquals("unit"))
 61                {
 862                    if (property.Value.ValueKind == JsonValueKind.Null)
 63                    {
 64                        continue;
 65                    }
 866                    unit = property.Value.GetString();
 67                    continue;
 68                }
 69            }
 870            return new VirtualNetworkUsage(currentValue, id, limit, name, unit);
 71        }
 72    }
 73}