< Summary

Class:Azure.ResourceManager.Compute.Models.DiskSku
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\DiskSku.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\DiskSku.Serialization.cs
Covered lines:28
Uncovered lines:0
Coverable lines:28
Total lines:91
Line coverage:100% (28 of 28)
Covered branches:14
Total branches:14
Branch coverage:100% (14 of 14)

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%
DeserializeDiskSku(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\DiskSku.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.Compute.Models
 9{
 10    /// <summary> The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. </summary>
 11    public partial class DiskSku
 12    {
 13        /// <summary> Initializes a new instance of DiskSku. </summary>
 6814        public DiskSku()
 15        {
 6816        }
 17
 18        /// <summary> Initializes a new instance of DiskSku. </summary>
 19        /// <param name="name"> The sku name. </param>
 20        /// <param name="tier"> The sku tier. </param>
 23621        internal DiskSku(DiskStorageAccountTypes? name, string tier)
 22        {
 23623            Name = name;
 23624            Tier = tier;
 23625        }
 26
 27        /// <summary> The sku name. </summary>
 87228        public DiskStorageAccountTypes? Name { get; set; }
 29        /// <summary> The sku tier. </summary>
 20430        public string Tier { get; }
 31    }
 32}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\DiskSku.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.Compute.Models
 12{
 13    public partial class DiskSku : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 18817            writer.WriteStartObject();
 18818            if (Name != null)
 19            {
 18820                writer.WritePropertyName("name");
 18821                writer.WriteStringValue(Name.Value.ToString());
 22            }
 18823            if (Tier != null)
 24            {
 1625                writer.WritePropertyName("tier");
 1626                writer.WriteStringValue(Tier);
 27            }
 18828            writer.WriteEndObject();
 18829        }
 30
 31        internal static DiskSku DeserializeDiskSku(JsonElement element)
 32        {
 22833            DiskStorageAccountTypes? name = default;
 22834            string tier = default;
 136835            foreach (var property in element.EnumerateObject())
 36            {
 45637                if (property.NameEquals("name"))
 38                {
 22839                    if (property.Value.ValueKind == JsonValueKind.Null)
 40                    {
 41                        continue;
 42                    }
 22843                    name = new DiskStorageAccountTypes(property.Value.GetString());
 22844                    continue;
 45                }
 22846                if (property.NameEquals("tier"))
 47                {
 22848                    if (property.Value.ValueKind == JsonValueKind.Null)
 49                    {
 50                        continue;
 51                    }
 22852                    tier = property.Value.GetString();
 53                    continue;
 54                }
 55            }
 22856            return new DiskSku(name, tier);
 57        }
 58    }
 59}