< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\ClusterSku.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 particular to a cluster instance. </summary>
 11    public partial class ClusterSku
 12    {
 13        /// <summary> Initializes a new instance of ClusterSku. </summary>
 014        public ClusterSku()
 15        {
 016            Name = "Dedicated";
 017        }
 18
 19        /// <summary> Initializes a new instance of ClusterSku. </summary>
 20        /// <param name="name"> Name of this SKU. </param>
 21        /// <param name="capacity"> The quantity of Event Hubs Cluster Capacity Units contained in this cluster. </param
 022        internal ClusterSku(string name, int? capacity)
 23        {
 024            Name = name;
 025            Capacity = capacity;
 026        }
 27
 28        /// <summary> Name of this SKU. </summary>
 029        public string Name { get; set; }
 30        /// <summary> The quantity of Event Hubs Cluster Capacity Units contained in this cluster. </summary>
 031        public int? Capacity { get; set; }
 32    }
 33}

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\ClusterSku.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 ClusterSku : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("name");
 019            writer.WriteStringValue(Name);
 020            if (Capacity != null)
 21            {
 022                writer.WritePropertyName("capacity");
 023                writer.WriteNumberValue(Capacity.Value);
 24            }
 025            writer.WriteEndObject();
 026        }
 27
 28        internal static ClusterSku DeserializeClusterSku(JsonElement element)
 29        {
 030            string name = default;
 031            int? capacity = default;
 032            foreach (var property in element.EnumerateObject())
 33            {
 034                if (property.NameEquals("name"))
 35                {
 036                    name = property.Value.GetString();
 037                    continue;
 38                }
 039                if (property.NameEquals("capacity"))
 40                {
 041                    if (property.Value.ValueKind == JsonValueKind.Null)
 42                    {
 43                        continue;
 44                    }
 045                    capacity = property.Value.GetInt32();
 46                    continue;
 47                }
 48            }
 049            return new ClusterSku(name, capacity);
 50        }
 51    }
 52}