< Summary

Class:Azure.ResourceManager.KeyVault.Models.Sku
Assembly:Azure.ResourceManager.KeyVault
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\Sku.cs
C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\src\Generated\Models\Sku.Serialization.cs
Covered lines:22
Uncovered lines:0
Coverable lines:22
Total lines:72
Line coverage:100% (22 of 22)
Covered branches:6
Total branches:6
Branch coverage:100% (6 of 6)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\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.KeyVault.Models
 9{
 10    /// <summary> SKU details. </summary>
 11    public partial class Sku
 12    {
 13        /// <summary> Initializes a new instance of Sku. </summary>
 14        /// <param name="family"> SKU family name. </param>
 15        /// <param name="name"> SKU name to specify whether the key vault is a standard vault or a premium vault. </para
 10016        public Sku(SkuFamily family, SkuName name)
 17        {
 10018            Family = family;
 10019            Name = name;
 10020        }
 21
 22        /// <summary> SKU family name. </summary>
 20423        public SkuFamily Family { get; set; }
 24        /// <summary> SKU name to specify whether the key vault is a standard vault or a premium vault. </summary>
 24425        public SkuName Name { get; set; }
 26    }
 27}

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.ResourceManager.KeyVault\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.KeyVault.Models
 12{
 13    public partial class Sku : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 10417            writer.WriteStartObject();
 10418            writer.WritePropertyName("family");
 10419            writer.WriteStringValue(Family.ToString());
 10420            writer.WritePropertyName("name");
 10421            writer.WriteStringValue(Name.ToSerialString());
 10422            writer.WriteEndObject();
 10423        }
 24
 25        internal static Sku DeserializeSku(JsonElement element)
 26        {
 7627            SkuFamily family = default;
 7628            SkuName name = default;
 45629            foreach (var property in element.EnumerateObject())
 30            {
 15231                if (property.NameEquals("family"))
 32                {
 7633                    family = new SkuFamily(property.Value.GetString());
 7634                    continue;
 35                }
 7636                if (property.NameEquals("name"))
 37                {
 7638                    name = property.Value.GetString().ToSkuName();
 39                    continue;
 40                }
 41            }
 7642            return new Sku(family, name);
 43        }
 44    }
 45}