< Summary

Class:Azure.ResourceManager.Storage.Models.UsageName
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\UsageName.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\UsageName.Serialization.cs
Covered lines:17
Uncovered lines:2
Coverable lines:19
Total lines:75
Line coverage:89.4% (17 of 19)
Covered branches:10
Total branches:10
Branch coverage:100% (10 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Value()-100%100%
get_LocalizedValue()-100%100%
DeserializeUsageName(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\UsageName.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.Storage.Models
 9{
 10    /// <summary> The usage names that can be used; currently limited to StorageAccount. </summary>
 11    public partial class UsageName
 12    {
 13        /// <summary> Initializes a new instance of UsageName. </summary>
 014        internal UsageName()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of UsageName. </summary>
 19        /// <param name="value"> Gets a string describing the resource name. </param>
 20        /// <param name="localizedValue"> Gets a localized string describing the resource name. </param>
 421        internal UsageName(string value, string localizedValue)
 22        {
 423            Value = value;
 424            LocalizedValue = localizedValue;
 425        }
 26
 27        /// <summary> Gets a string describing the resource name. </summary>
 428        public string Value { get; }
 29        /// <summary> Gets a localized string describing the resource name. </summary>
 430        public string LocalizedValue { get; }
 31    }
 32}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\UsageName.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.Storage.Models
 12{
 13    public partial class UsageName
 14    {
 15        internal static UsageName DeserializeUsageName(JsonElement element)
 16        {
 417            string value = default;
 418            string localizedValue = default;
 2419            foreach (var property in element.EnumerateObject())
 20            {
 821                if (property.NameEquals("value"))
 22                {
 423                    if (property.Value.ValueKind == JsonValueKind.Null)
 24                    {
 25                        continue;
 26                    }
 427                    value = property.Value.GetString();
 428                    continue;
 29                }
 430                if (property.NameEquals("localizedValue"))
 31                {
 432                    if (property.Value.ValueKind == JsonValueKind.Null)
 33                    {
 34                        continue;
 35                    }
 436                    localizedValue = property.Value.GetString();
 37                    continue;
 38                }
 39            }
 440            return new UsageName(value, localizedValue);
 41        }
 42    }
 43}