< Summary

Class:Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetStorageProfile
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetStorageProfile.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetStorageProfile.Serialization.cs
Covered lines:45
Uncovered lines:1
Coverable lines:46
Total lines:130
Line coverage:97.8% (45 of 46)
Covered branches:25
Total branches:26
Branch coverage:96.1% (25 of 26)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_ImageReference()-100%100%
get_OsDisk()-100%100%
get_DataDisks()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeVirtualMachineScaleSetStorageProfile(...)-95.24%94.44%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetStorageProfile.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.Collections.Generic;
 9
 10namespace Azure.ResourceManager.Compute.Models
 11{
 12    /// <summary> Describes a virtual machine scale set storage profile. </summary>
 13    public partial class VirtualMachineScaleSetStorageProfile
 14    {
 15        /// <summary> Initializes a new instance of VirtualMachineScaleSetStorageProfile. </summary>
 16016        public VirtualMachineScaleSetStorageProfile()
 17        {
 16018        }
 19
 20        /// <summary> Initializes a new instance of VirtualMachineScaleSetStorageProfile. </summary>
 21        /// <param name="imageReference"> Specifies information about the image to use. You can specify information abou
 22        /// <param name="osDisk"> Specifies information about the operating system disk used by the virtual machines in 
 23        /// <param name="dataDisks"> Specifies the parameters that are used to add data disks to the virtual machines in
 44824        internal VirtualMachineScaleSetStorageProfile(ImageReference imageReference, VirtualMachineScaleSetOSDisk osDisk
 25        {
 44826            ImageReference = imageReference;
 44827            OsDisk = osDisk;
 44828            DataDisks = dataDisks;
 44829        }
 30
 31        /// <summary> Specifies information about the image to use. You can specify information about platform images, m
 137632        public ImageReference ImageReference { get; set; }
 33        /// <summary> Specifies information about the operating system disk used by the virtual machines in the scale se
 258834        public VirtualMachineScaleSetOSDisk OsDisk { get; set; }
 35        /// <summary> Specifies the parameters that are used to add data disks to the virtual machines in the scale set.
 257636        public IList<VirtualMachineScaleSetDataDisk> DataDisks { get; set; }
 37    }
 38}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetStorageProfile.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Compute.Models
 13{
 14    public partial class VirtualMachineScaleSetStorageProfile : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 36418            writer.WriteStartObject();
 36419            if (ImageReference != null)
 20            {
 36421                writer.WritePropertyName("imageReference");
 36422                writer.WriteObjectValue(ImageReference);
 23            }
 36424            if (OsDisk != null)
 25            {
 13226                writer.WritePropertyName("osDisk");
 13227                writer.WriteObjectValue(OsDisk);
 28            }
 36429            if (DataDisks != null)
 30            {
 24831                writer.WritePropertyName("dataDisks");
 24832                writer.WriteStartArray();
 99233                foreach (var item in DataDisks)
 34                {
 24835                    writer.WriteObjectValue(item);
 36                }
 24837                writer.WriteEndArray();
 38            }
 36439            writer.WriteEndObject();
 36440        }
 41
 42        internal static VirtualMachineScaleSetStorageProfile DeserializeVirtualMachineScaleSetStorageProfile(JsonElement
 43        {
 44844            ImageReference imageReference = default;
 44845            VirtualMachineScaleSetOSDisk osDisk = default;
 44846            IList<VirtualMachineScaleSetDataDisk> dataDisks = default;
 328847            foreach (var property in element.EnumerateObject())
 48            {
 119649                if (property.NameEquals("imageReference"))
 50                {
 44851                    if (property.Value.ValueKind == JsonValueKind.Null)
 52                    {
 53                        continue;
 54                    }
 44855                    imageReference = ImageReference.DeserializeImageReference(property.Value);
 44856                    continue;
 57                }
 74858                if (property.NameEquals("osDisk"))
 59                {
 44860                    if (property.Value.ValueKind == JsonValueKind.Null)
 61                    {
 62                        continue;
 63                    }
 44864                    osDisk = VirtualMachineScaleSetOSDisk.DeserializeVirtualMachineScaleSetOSDisk(property.Value);
 44865                    continue;
 66                }
 30067                if (property.NameEquals("dataDisks"))
 68                {
 30069                    if (property.Value.ValueKind == JsonValueKind.Null)
 70                    {
 71                        continue;
 72                    }
 30073                    List<VirtualMachineScaleSetDataDisk> array = new List<VirtualMachineScaleSetDataDisk>();
 120074                    foreach (var item in property.Value.EnumerateArray())
 75                    {
 30076                        if (item.ValueKind == JsonValueKind.Null)
 77                        {
 078                            array.Add(null);
 79                        }
 80                        else
 81                        {
 30082                            array.Add(VirtualMachineScaleSetDataDisk.DeserializeVirtualMachineScaleSetDataDisk(item));
 83                        }
 84                    }
 30085                    dataDisks = array;
 86                    continue;
 87                }
 88            }
 44889            return new VirtualMachineScaleSetStorageProfile(imageReference, osDisk, dataDisks);
 90        }
 91    }
 92}