< Summary

Class:Azure.ResourceManager.Compute.Models.Sku
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\Sku.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\Sku.Serialization.cs
Covered lines:38
Uncovered lines:0
Coverable lines:38
Total lines:110
Line coverage:100% (38 of 38)
Covered branches:20
Total branches:20
Branch coverage:100% (20 of 20)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Name()-100%100%
get_Tier()-100%100%
get_Capacity()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeSku(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\Sku.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.Compute.Models
 9{
 10    /// <summary> Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware th
 11    public partial class Sku
 12    {
 13        /// <summary> Initializes a new instance of Sku. </summary>
 28014        public Sku()
 15        {
 28016        }
 17
 18        /// <summary> Initializes a new instance of Sku. </summary>
 19        /// <param name="name"> The sku name. </param>
 20        /// <param name="tier"> Specifies the tier of virtual machines in a scale set.&lt;br /&gt;&lt;br /&gt; Possible 
 21        /// <param name="capacity"> Specifies the number of virtual machines in the scale set. </param>
 288422        internal Sku(string name, string tier, long? capacity)
 23        {
 288424            Name = name;
 288425            Tier = tier;
 288426            Capacity = capacity;
 288427        }
 28
 29        /// <summary> The sku name. </summary>
 480430        public string Name { get; set; }
 31        /// <summary> Specifies the tier of virtual machines in a scale set.&lt;br /&gt;&lt;br /&gt; Possible Values:&lt
 344432        public string Tier { get; set; }
 33        /// <summary> Specifies the number of virtual machines in the scale set. </summary>
 395634        public long? Capacity { get; set; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\Sku.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.Compute.Models
 12{
 13    public partial class Sku : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 48817            writer.WriteStartObject();
 48818            if (Name != null)
 19            {
 48820                writer.WritePropertyName("name");
 48821                writer.WriteStringValue(Name);
 22            }
 48823            if (Tier != null)
 24            {
 4825                writer.WritePropertyName("tier");
 4826                writer.WriteStringValue(Tier);
 27            }
 48828            if (Capacity != null)
 29            {
 36430                writer.WritePropertyName("capacity");
 36431                writer.WriteNumberValue(Capacity.Value);
 32            }
 48833            writer.WriteEndObject();
 48834        }
 35
 36        internal static Sku DeserializeSku(JsonElement element)
 37        {
 288438            string name = default;
 288439            string tier = default;
 288440            long? capacity = default;
 1781641            foreach (var property in element.EnumerateObject())
 42            {
 602443                if (property.NameEquals("name"))
 44                {
 288445                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 288449                    name = property.Value.GetString();
 288450                    continue;
 51                }
 314052                if (property.NameEquals("tier"))
 53                {
 269254                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 269258                    tier = property.Value.GetString();
 269259                    continue;
 60                }
 44861                if (property.NameEquals("capacity"))
 62                {
 44863                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 44867                    capacity = property.Value.GetInt64();
 68                    continue;
 69                }
 70            }
 288471            return new Sku(name, tier, capacity);
 72        }
 73    }
 74}