< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_VCPUs()-0%100%
get_Memory()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeRecommendedMachineConfiguration(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RecommendedMachineConfiguration.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 properties describe the recommended machine configuration for this Image Definition. These propert
 11    public partial class RecommendedMachineConfiguration
 12    {
 13        /// <summary> Initializes a new instance of RecommendedMachineConfiguration. </summary>
 014        public RecommendedMachineConfiguration()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of RecommendedMachineConfiguration. </summary>
 19        /// <param name="vCPUs"> Describes the resource range. </param>
 20        /// <param name="memory"> Describes the resource range. </param>
 021        internal RecommendedMachineConfiguration(ResourceRange vCPUs, ResourceRange memory)
 22        {
 023            VCPUs = vCPUs;
 024            Memory = memory;
 025        }
 26
 27        /// <summary> Describes the resource range. </summary>
 028        public ResourceRange VCPUs { get; set; }
 29        /// <summary> Describes the resource range. </summary>
 030        public ResourceRange Memory { get; set; }
 31    }
 32}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RecommendedMachineConfiguration.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 RecommendedMachineConfiguration : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (VCPUs != null)
 19            {
 020                writer.WritePropertyName("vCPUs");
 021                writer.WriteObjectValue(VCPUs);
 22            }
 023            if (Memory != null)
 24            {
 025                writer.WritePropertyName("memory");
 026                writer.WriteObjectValue(Memory);
 27            }
 028            writer.WriteEndObject();
 029        }
 30
 31        internal static RecommendedMachineConfiguration DeserializeRecommendedMachineConfiguration(JsonElement element)
 32        {
 033            ResourceRange vCPUs = default;
 034            ResourceRange memory = default;
 035            foreach (var property in element.EnumerateObject())
 36            {
 037                if (property.NameEquals("vCPUs"))
 38                {
 039                    if (property.Value.ValueKind == JsonValueKind.Null)
 40                    {
 41                        continue;
 42                    }
 043                    vCPUs = ResourceRange.DeserializeResourceRange(property.Value);
 044                    continue;
 45                }
 046                if (property.NameEquals("memory"))
 47                {
 048                    if (property.Value.ValueKind == JsonValueKind.Null)
 49                    {
 50                        continue;
 51                    }
 052                    memory = ResourceRange.DeserializeResourceRange(property.Value);
 53                    continue;
 54                }
 55            }
 056            return new RecommendedMachineConfiguration(vCPUs, memory);
 57        }
 58    }
 59}