< Summary

Class:Azure.ResourceManager.Storage.Models.Sku
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\Sku.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\Sku.Serialization.cs
Covered lines:27
Uncovered lines:0
Coverable lines:27
Total lines:86
Line coverage:100% (27 of 27)
Covered branches:10
Total branches:10
Branch coverage:100% (10 of 10)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\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.Storage.Models
 9{
 10    /// <summary> The SKU of the storage account. </summary>
 11    public partial class Sku
 12    {
 13        /// <summary> Initializes a new instance of Sku. </summary>
 14        /// <param name="name"> The SKU name. Required for account creation; optional for update. Note that in older ver
 10215        public Sku(SkuName name)
 16        {
 10217            Name = name;
 10218        }
 19
 20        /// <summary> Initializes a new instance of Sku. </summary>
 21        /// <param name="name"> The SKU name. Required for account creation; optional for update. Note that in older ver
 22        /// <param name="tier"> The SKU tier. This is based on the SKU name. </param>
 88023        internal Sku(SkuName name, SkuTier? tier)
 24        {
 88025            Name = name;
 88026            Tier = tier;
 88027        }
 28
 29        /// <summary> The SKU name. Required for account creation; optional for update. Note that in older versions, SKU
 304230        public SkuName Name { get; set; }
 31        /// <summary> The SKU tier. This is based on the SKU name. </summary>
 88032        public SkuTier? Tier { get; }
 33    }
 34}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\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.Storage.Models
 12{
 13    public partial class Sku : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 62417            writer.WriteStartObject();
 62418            writer.WritePropertyName("name");
 62419            writer.WriteStringValue(Name.ToString());
 62420            if (Tier != null)
 21            {
 1622                writer.WritePropertyName("tier");
 1623                writer.WriteStringValue(Tier.Value.ToSerialString());
 24            }
 62425            writer.WriteEndObject();
 62426        }
 27
 28        internal static Sku DeserializeSku(JsonElement element)
 29        {
 88030            SkuName name = default;
 88031            SkuTier? tier = default;
 528032            foreach (var property in element.EnumerateObject())
 33            {
 176034                if (property.NameEquals("name"))
 35                {
 88036                    name = new SkuName(property.Value.GetString());
 88037                    continue;
 38                }
 88039                if (property.NameEquals("tier"))
 40                {
 88041                    if (property.Value.ValueKind == JsonValueKind.Null)
 42                    {
 43                        continue;
 44                    }
 88045                    tier = property.Value.GetString().ToSkuTier();
 46                    continue;
 47                }
 48            }
 88049            return new Sku(name, tier);
 50        }
 51    }
 52}