< Summary

Class:Azure.ResourceManager.Resources.Models.Sku
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Sku.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Sku.Serialization.cs
Covered lines:55
Uncovered lines:13
Coverable lines:68
Total lines:167
Line coverage:80.8% (55 of 68)
Covered branches:31
Total branches:38
Branch coverage:81.5% (31 of 38)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Name()-100%100%
get_Tier()-100%100%
get_Size()-100%100%
get_Family()-100%100%
get_Model()-100%100%
get_Capacity()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-52.38%58.33%
DeserializeSku(...)-90.32%92.31%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\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.Resources.Models
 9{
 10    /// <summary> SKU for the resource. </summary>
 11    public partial class Sku
 12    {
 13        /// <summary> Initializes a new instance of Sku. </summary>
 3614        public Sku()
 15        {
 3616        }
 17
 18        /// <summary> Initializes a new instance of Sku. </summary>
 19        /// <param name="name"> The SKU name. </param>
 20        /// <param name="tier"> The SKU tier. </param>
 21        /// <param name="size"> The SKU size. </param>
 22        /// <param name="family"> The SKU family. </param>
 23        /// <param name="model"> The SKU model. </param>
 24        /// <param name="capacity"> The SKU capacity. </param>
 14425        internal Sku(string name, string tier, string size, string family, string model, int? capacity)
 26        {
 14427            Name = name;
 14428            Tier = tier;
 14429            Size = size;
 14430            Family = family;
 14431            Model = model;
 14432            Capacity = capacity;
 14433        }
 34
 35        /// <summary> The SKU name. </summary>
 33236        public string Name { get; set; }
 37        /// <summary> The SKU tier. </summary>
 22438        public string Tier { get; set; }
 39        /// <summary> The SKU size. </summary>
 22440        public string Size { get; set; }
 41        /// <summary> The SKU family. </summary>
 22442        public string Family { get; set; }
 43        /// <summary> The SKU model. </summary>
 21644        public string Model { get; set; }
 45        /// <summary> The SKU capacity. </summary>
 22446        public int? Capacity { get; set; }
 47    }
 48}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\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.Resources.Models
 12{
 13    public partial class Sku : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 7217            writer.WriteStartObject();
 7218            if (Name != null)
 19            {
 7220                writer.WritePropertyName("name");
 7221                writer.WriteStringValue(Name);
 22            }
 7223            if (Tier != null)
 24            {
 025                writer.WritePropertyName("tier");
 026                writer.WriteStringValue(Tier);
 27            }
 7228            if (Size != null)
 29            {
 030                writer.WritePropertyName("size");
 031                writer.WriteStringValue(Size);
 32            }
 7233            if (Family != null)
 34            {
 035                writer.WritePropertyName("family");
 036                writer.WriteStringValue(Family);
 37            }
 7238            if (Model != null)
 39            {
 040                writer.WritePropertyName("model");
 041                writer.WriteStringValue(Model);
 42            }
 7243            if (Capacity != null)
 44            {
 045                writer.WritePropertyName("capacity");
 046                writer.WriteNumberValue(Capacity.Value);
 47            }
 7248            writer.WriteEndObject();
 7249        }
 50
 51        internal static Sku DeserializeSku(JsonElement element)
 52        {
 14453            string name = default;
 14454            string tier = default;
 14455            string size = default;
 14456            string family = default;
 14457            string model = default;
 14458            int? capacity = default;
 120859            foreach (var property in element.EnumerateObject())
 60            {
 46061                if (property.NameEquals("name"))
 62                {
 14463                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 14467                    name = property.Value.GetString();
 14468                    continue;
 69                }
 31670                if (property.NameEquals("tier"))
 71                {
 12072                    if (property.Value.ValueKind == JsonValueKind.Null)
 73                    {
 74                        continue;
 75                    }
 12076                    tier = property.Value.GetString();
 12077                    continue;
 78                }
 19679                if (property.NameEquals("size"))
 80                {
 6481                    if (property.Value.ValueKind == JsonValueKind.Null)
 82                    {
 83                        continue;
 84                    }
 6485                    size = property.Value.GetString();
 6486                    continue;
 87                }
 13288                if (property.NameEquals("family"))
 89                {
 6490                    if (property.Value.ValueKind == JsonValueKind.Null)
 91                    {
 92                        continue;
 93                    }
 6494                    family = property.Value.GetString();
 6495                    continue;
 96                }
 6897                if (property.NameEquals("model"))
 98                {
 099                    if (property.Value.ValueKind == JsonValueKind.Null)
 100                    {
 101                        continue;
 102                    }
 0103                    model = property.Value.GetString();
 0104                    continue;
 105                }
 68106                if (property.NameEquals("capacity"))
 107                {
 68108                    if (property.Value.ValueKind == JsonValueKind.Null)
 109                    {
 110                        continue;
 111                    }
 68112                    capacity = property.Value.GetInt32();
 113                    continue;
 114                }
 115            }
 144116            return new Sku(name, tier, size, family, model, capacity);
 117        }
 118    }
 119}