< Summary

Class:Azure.ResourceManager.Compute.Models.GalleryImageIdentifier
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryImageIdentifier.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryImageIdentifier.Serialization.cs
Covered lines:33
Uncovered lines:3
Coverable lines:36
Total lines:99
Line coverage:91.6% (33 of 36)
Covered branches:11
Total branches:14
Branch coverage:78.5% (11 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-72.73%50%
get_Publisher()-100%100%
get_Offer()-100%100%
get_Sku()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeGalleryImageIdentifier(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryImageIdentifier.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;
 9
 10namespace Azure.ResourceManager.Compute.Models
 11{
 12    /// <summary> This is the gallery Image Definition identifier. </summary>
 13    public partial class GalleryImageIdentifier
 14    {
 15        /// <summary> Initializes a new instance of GalleryImageIdentifier. </summary>
 16        /// <param name="publisher"> The name of the gallery Image Definition publisher. </param>
 17        /// <param name="offer"> The name of the gallery Image Definition offer. </param>
 18        /// <param name="sku"> The name of the gallery Image Definition SKU. </param>
 3219        public GalleryImageIdentifier(string publisher, string offer, string sku)
 20        {
 3221            if (publisher == null)
 22            {
 023                throw new ArgumentNullException(nameof(publisher));
 24            }
 3225            if (offer == null)
 26            {
 027                throw new ArgumentNullException(nameof(offer));
 28            }
 3229            if (sku == null)
 30            {
 031                throw new ArgumentNullException(nameof(sku));
 32            }
 33
 3234            Publisher = publisher;
 3235            Offer = offer;
 3236            Sku = sku;
 3237        }
 38
 39        /// <summary> The name of the gallery Image Definition publisher. </summary>
 7240        public string Publisher { get; set; }
 41        /// <summary> The name of the gallery Image Definition offer. </summary>
 7242        public string Offer { get; set; }
 43        /// <summary> The name of the gallery Image Definition SKU. </summary>
 7244        public string Sku { get; set; }
 45    }
 46}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\GalleryImageIdentifier.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 GalleryImageIdentifier : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 2417            writer.WriteStartObject();
 2418            writer.WritePropertyName("publisher");
 2419            writer.WriteStringValue(Publisher);
 2420            writer.WritePropertyName("offer");
 2421            writer.WriteStringValue(Offer);
 2422            writer.WritePropertyName("sku");
 2423            writer.WriteStringValue(Sku);
 2424            writer.WriteEndObject();
 2425        }
 26
 27        internal static GalleryImageIdentifier DeserializeGalleryImageIdentifier(JsonElement element)
 28        {
 2429            string publisher = default;
 2430            string offer = default;
 2431            string sku = default;
 19232            foreach (var property in element.EnumerateObject())
 33            {
 7234                if (property.NameEquals("publisher"))
 35                {
 2436                    publisher = property.Value.GetString();
 2437                    continue;
 38                }
 4839                if (property.NameEquals("offer"))
 40                {
 2441                    offer = property.Value.GetString();
 2442                    continue;
 43                }
 2444                if (property.NameEquals("sku"))
 45                {
 2446                    sku = property.Value.GetString();
 47                    continue;
 48                }
 49            }
 2450            return new GalleryImageIdentifier(publisher, offer, sku);
 51        }
 52    }
 53}