< Summary

Class:Azure.ResourceManager.Compute.Models.ResourceSkuRestrictionInfo
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ResourceSkuRestrictionInfo.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ResourceSkuRestrictionInfo.Serialization.cs
Covered lines:23
Uncovered lines:6
Coverable lines:29
Total lines:102
Line coverage:79.3% (23 of 29)
Covered branches:16
Total branches:18
Branch coverage:88.8% (16 of 18)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Locations()-0%100%
get_Zones()-0%100%
DeserializeResourceSkuRestrictionInfo(...)-90.48%88.89%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ResourceSkuRestrictionInfo.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.Compute.Models
 11{
 12    /// <summary> The ResourceSkuRestrictionInfo. </summary>
 13    public partial class ResourceSkuRestrictionInfo
 14    {
 15        /// <summary> Initializes a new instance of ResourceSkuRestrictionInfo. </summary>
 016        internal ResourceSkuRestrictionInfo()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ResourceSkuRestrictionInfo. </summary>
 21        /// <param name="locations"> Locations where the SKU is restricted. </param>
 22        /// <param name="zones"> List of availability zones where the SKU is restricted. </param>
 1521223        internal ResourceSkuRestrictionInfo(IReadOnlyList<string> locations, IReadOnlyList<string> zones)
 24        {
 1521225            Locations = locations;
 1521226            Zones = zones;
 1521227        }
 28
 29        /// <summary> Locations where the SKU is restricted. </summary>
 030        public IReadOnlyList<string> Locations { get; }
 31        /// <summary> List of availability zones where the SKU is restricted. </summary>
 032        public IReadOnlyList<string> Zones { get; }
 33    }
 34}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ResourceSkuRestrictionInfo.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.Compute.Models
 13{
 14    public partial class ResourceSkuRestrictionInfo
 15    {
 16        internal static ResourceSkuRestrictionInfo DeserializeResourceSkuRestrictionInfo(JsonElement element)
 17        {
 1521218            IReadOnlyList<string> locations = default;
 1521219            IReadOnlyList<string> zones = default;
 7165620            foreach (var property in element.EnumerateObject())
 21            {
 2061622                if (property.NameEquals("locations"))
 23                {
 1521224                    if (property.Value.ValueKind == JsonValueKind.Null)
 25                    {
 26                        continue;
 27                    }
 1521228                    List<string> array = new List<string>();
 6084829                    foreach (var item in property.Value.EnumerateArray())
 30                    {
 1521231                        if (item.ValueKind == JsonValueKind.Null)
 32                        {
 033                            array.Add(null);
 34                        }
 35                        else
 36                        {
 1521237                            array.Add(item.GetString());
 38                        }
 39                    }
 1521240                    locations = array;
 1521241                    continue;
 42                }
 540443                if (property.NameEquals("zones"))
 44                {
 540445                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 540449                    List<string> array = new List<string>();
 3832050                    foreach (var item in property.Value.EnumerateArray())
 51                    {
 1375652                        if (item.ValueKind == JsonValueKind.Null)
 53                        {
 054                            array.Add(null);
 55                        }
 56                        else
 57                        {
 1375658                            array.Add(item.GetString());
 59                        }
 60                    }
 540461                    zones = array;
 62                    continue;
 63                }
 64            }
 1521265            return new ResourceSkuRestrictionInfo(locations, zones);
 66        }
 67    }
 68}