< Summary

Class:Azure.ResourceManager.Compute.Models.GalleryIdentifier
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryIdentifier.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryIdentifier.Serialization.cs
Covered lines:10
Uncovered lines:8
Coverable lines:18
Total lines:72
Line coverage:55.5% (10 of 18)
Covered branches:6
Total branches:8
Branch coverage:75% (6 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_UniqueName()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeGalleryIdentifier(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryIdentifier.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> Describes the gallery unique name. </summary>
 11    public partial class GalleryIdentifier
 12    {
 13        /// <summary> Initializes a new instance of GalleryIdentifier. </summary>
 014        public GalleryIdentifier()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of GalleryIdentifier. </summary>
 19        /// <param name="uniqueName"> The unique name of the Shared Image Gallery. This name is generated automatically 
 5420        internal GalleryIdentifier(string uniqueName)
 21        {
 5422            UniqueName = uniqueName;
 5423        }
 24
 25        /// <summary> The unique name of the Shared Image Gallery. This name is generated automatically by Azure. </summ
 826        public string UniqueName { get; }
 27    }
 28}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryIdentifier.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 GalleryIdentifier : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (UniqueName != null)
 19            {
 020                writer.WritePropertyName("uniqueName");
 021                writer.WriteStringValue(UniqueName);
 22            }
 023            writer.WriteEndObject();
 024        }
 25
 26        internal static GalleryIdentifier DeserializeGalleryIdentifier(JsonElement element)
 27        {
 5428            string uniqueName = default;
 21629            foreach (var property in element.EnumerateObject())
 30            {
 5431                if (property.NameEquals("uniqueName"))
 32                {
 5433                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 5437                    uniqueName = property.Value.GetString();
 38                    continue;
 39                }
 40            }
 5441            return new GalleryIdentifier(uniqueName);
 42        }
 43    }
 44}