< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_VmSize()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeHardwareProfile(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\HardwareProfile.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> Specifies the hardware settings for the virtual machine. </summary>
 11    public partial class HardwareProfile
 12    {
 13        /// <summary> Initializes a new instance of HardwareProfile. </summary>
 11614        public HardwareProfile()
 15        {
 11616        }
 17
 18        /// <summary> Initializes a new instance of HardwareProfile. </summary>
 19        /// <param name="vmSize"> Specifies the size of the virtual machine. For more information about virtual machine 
 43220        internal HardwareProfile(VirtualMachineSizeTypes? vmSize)
 21        {
 43222            VmSize = vmSize;
 43223        }
 24
 25        /// <summary> Specifies the size of the virtual machine. For more information about virtual machine sizes, see [
 136026        public VirtualMachineSizeTypes? VmSize { get; set; }
 27    }
 28}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\HardwareProfile.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 HardwareProfile : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 24417            writer.WriteStartObject();
 24418            if (VmSize != null)
 19            {
 24420                writer.WritePropertyName("vmSize");
 24421                writer.WriteStringValue(VmSize.Value.ToString());
 22            }
 24423            writer.WriteEndObject();
 24424        }
 25
 26        internal static HardwareProfile DeserializeHardwareProfile(JsonElement element)
 27        {
 43228            VirtualMachineSizeTypes? vmSize = default;
 155229            foreach (var property in element.EnumerateObject())
 30            {
 34431                if (property.NameEquals("vmSize"))
 32                {
 34433                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 34437                    vmSize = new VirtualMachineSizeTypes(property.Value.GetString());
 38                    continue;
 39                }
 40            }
 43241            return new HardwareProfile(vmSize);
 42        }
 43    }
 44}