< Summary

Class:Azure.ResourceManager.Compute.Models.UsageName
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\UsageName.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\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\compute\Azure.ResourceManager.Compute\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.Compute.Models
 9{
 10    /// <summary> The Usage Names. </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"> The name of the resource. </param>
 20        /// <param name="localizedValue"> The localized name of the resource. </param>
 28821        internal UsageName(string value, string localizedValue)
 22        {
 28823            Value = value;
 28824            LocalizedValue = localizedValue;
 28825        }
 26
 27        /// <summary> The name of the resource. </summary>
 28828        public string Value { get; }
 29        /// <summary> The localized name of the resource. </summary>
 28830        public string LocalizedValue { get; }
 31    }
 32}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\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.Compute.Models
 12{
 13    public partial class UsageName
 14    {
 15        internal static UsageName DeserializeUsageName(JsonElement element)
 16        {
 28817            string value = default;
 28818            string localizedValue = default;
 172819            foreach (var property in element.EnumerateObject())
 20            {
 57621                if (property.NameEquals("value"))
 22                {
 28823                    if (property.Value.ValueKind == JsonValueKind.Null)
 24                    {
 25                        continue;
 26                    }
 28827                    value = property.Value.GetString();
 28828                    continue;
 29                }
 28830                if (property.NameEquals("localizedValue"))
 31                {
 28832                    if (property.Value.ValueKind == JsonValueKind.Null)
 33                    {
 34                        continue;
 35                    }
 28836                    localizedValue = property.Value.GetString();
 37                    continue;
 38                }
 39            }
 28840            return new UsageName(value, localizedValue);
 41        }
 42    }
 43}