< Summary

Class:Azure.ResourceManager.Compute.Models.SnapshotSku
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SnapshotSku.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SnapshotSku.Serialization.cs
Covered lines:26
Uncovered lines:2
Coverable lines:28
Total lines:91
Line coverage:92.8% (26 of 28)
Covered branches:13
Total branches:14
Branch coverage:92.8% (13 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(...)-77.78%75%
DeserializeSnapshotSku(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SnapshotSku.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 snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. </summary>
 11    public partial class SnapshotSku
 12    {
 13        /// <summary> Initializes a new instance of SnapshotSku. </summary>
 2414        public SnapshotSku()
 15        {
 2416        }
 17
 18        /// <summary> Initializes a new instance of SnapshotSku. </summary>
 19        /// <param name="name"> The sku name. </param>
 20        /// <param name="tier"> The sku tier. </param>
 8821        internal SnapshotSku(SnapshotStorageAccountTypes? name, string tier)
 22        {
 8823            Name = name;
 8824            Tier = tier;
 8825        }
 26
 27        /// <summary> The sku name. </summary>
 28828        public SnapshotStorageAccountTypes? Name { get; set; }
 29        /// <summary> The sku tier. </summary>
 4830        public string Tier { get; }
 31    }
 32}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SnapshotSku.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 SnapshotSku : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 4817            writer.WriteStartObject();
 4818            if (Name != null)
 19            {
 4820                writer.WritePropertyName("name");
 4821                writer.WriteStringValue(Name.Value.ToString());
 22            }
 4823            if (Tier != null)
 24            {
 025                writer.WritePropertyName("tier");
 026                writer.WriteStringValue(Tier);
 27            }
 4828            writer.WriteEndObject();
 4829        }
 30
 31        internal static SnapshotSku DeserializeSnapshotSku(JsonElement element)
 32        {
 8833            SnapshotStorageAccountTypes? name = default;
 8834            string tier = default;
 52835            foreach (var property in element.EnumerateObject())
 36            {
 17637                if (property.NameEquals("name"))
 38                {
 8839                    if (property.Value.ValueKind == JsonValueKind.Null)
 40                    {
 41                        continue;
 42                    }
 8843                    name = new SnapshotStorageAccountTypes(property.Value.GetString());
 8844                    continue;
 45                }
 8846                if (property.NameEquals("tier"))
 47                {
 8848                    if (property.Value.ValueKind == JsonValueKind.Null)
 49                    {
 50                        continue;
 51                    }
 8852                    tier = property.Value.GetString();
 53                    continue;
 54                }
 55            }
 8856            return new SnapshotSku(name, tier);
 57        }
 58    }
 59}