< Summary

Class:Azure.ResourceManager.EventHubs.Models.Sku
Assembly:Azure.ResourceManager.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\Sku.cs
C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\Sku.Serialization.cs
Covered lines:37
Uncovered lines:0
Coverable lines:37
Total lines:105
Line coverage:100% (37 of 37)
Covered branches:16
Total branches:16
Branch coverage:100% (16 of 16)

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\eventhub\Azure.ResourceManager.EventHubs\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.EventHubs.Models
 9{
 10    /// <summary> SKU parameters supplied to the create namespace operation. </summary>
 11    public partial class Sku
 12    {
 13        /// <summary> Initializes a new instance of Sku. </summary>
 14        /// <param name="name"> Name of this SKU. </param>
 2815        public Sku(SkuName name)
 16        {
 2817            Name = name;
 2818        }
 19
 20        /// <summary> Initializes a new instance of Sku. </summary>
 21        /// <param name="name"> Name of this SKU. </param>
 22        /// <param name="tier"> The billing tier of this particular SKU. </param>
 23        /// <param name="capacity"> The Event Hubs throughput units, value should be 0 to 20 throughput units. </param>
 14424        internal Sku(SkuName name, SkuTier? tier, int? capacity)
 25        {
 14426            Name = name;
 14427            Tier = tier;
 14428            Capacity = capacity;
 14429        }
 30
 31        /// <summary> Name of this SKU. </summary>
 22832        public SkuName Name { get; set; }
 33        /// <summary> The billing tier of this particular SKU. </summary>
 28434        public SkuTier? Tier { get; set; }
 35        /// <summary> The Event Hubs throughput units, value should be 0 to 20 throughput units. </summary>
 23636        public int? Capacity { get; set; }
 37    }
 38}

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\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.EventHubs.Models
 12{
 13    public partial class Sku : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 5617            writer.WriteStartObject();
 5618            writer.WritePropertyName("name");
 5619            writer.WriteStringValue(Name.ToString());
 5620            if (Tier != null)
 21            {
 5622                writer.WritePropertyName("tier");
 5623                writer.WriteStringValue(Tier.Value.ToString());
 24            }
 5625            if (Capacity != null)
 26            {
 2427                writer.WritePropertyName("capacity");
 2428                writer.WriteNumberValue(Capacity.Value);
 29            }
 5630            writer.WriteEndObject();
 5631        }
 32
 33        internal static Sku DeserializeSku(JsonElement element)
 34        {
 14435            SkuName name = default;
 14436            SkuTier? tier = default;
 14437            int? capacity = default;
 115238            foreach (var property in element.EnumerateObject())
 39            {
 43240                if (property.NameEquals("name"))
 41                {
 14442                    name = new SkuName(property.Value.GetString());
 14443                    continue;
 44                }
 28845                if (property.NameEquals("tier"))
 46                {
 14447                    if (property.Value.ValueKind == JsonValueKind.Null)
 48                    {
 49                        continue;
 50                    }
 14451                    tier = new SkuTier(property.Value.GetString());
 14452                    continue;
 53                }
 14454                if (property.NameEquals("capacity"))
 55                {
 14456                    if (property.Value.ValueKind == JsonValueKind.Null)
 57                    {
 58                        continue;
 59                    }
 14460                    capacity = property.Value.GetInt32();
 61                    continue;
 62                }
 63            }
 14464            return new Sku(name, tier, capacity);
 65        }
 66    }
 67}