< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\DedicatedHostAllocatableVM.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> Represents the dedicated host unutilized capacity in terms of a specific VM size. </summary>
 11    public partial class DedicatedHostAllocatableVM
 12    {
 13        /// <summary> Initializes a new instance of DedicatedHostAllocatableVM. </summary>
 014        public DedicatedHostAllocatableVM()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of DedicatedHostAllocatableVM. </summary>
 19        /// <param name="vmSize"> VM size in terms of which the unutilized capacity is represented. </param>
 20        /// <param name="count"> Maximum number of VMs of size vmSize that can fit in the dedicated host&apos;s remainin
 10021        internal DedicatedHostAllocatableVM(string vmSize, double? count)
 22        {
 10023            VmSize = vmSize;
 10024            Count = count;
 10025        }
 26
 27        /// <summary> VM size in terms of which the unutilized capacity is represented. </summary>
 028        public string VmSize { get; set; }
 29        /// <summary> Maximum number of VMs of size vmSize that can fit in the dedicated host&apos;s remaining capacity.
 030        public double? Count { get; set; }
 31    }
 32}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\DedicatedHostAllocatableVM.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 DedicatedHostAllocatableVM : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (VmSize != null)
 19            {
 020                writer.WritePropertyName("vmSize");
 021                writer.WriteStringValue(VmSize);
 22            }
 023            if (Count != null)
 24            {
 025                writer.WritePropertyName("count");
 026                writer.WriteNumberValue(Count.Value);
 27            }
 028            writer.WriteEndObject();
 029        }
 30
 31        internal static DedicatedHostAllocatableVM DeserializeDedicatedHostAllocatableVM(JsonElement element)
 32        {
 10033            string vmSize = default;
 10034            double? count = default;
 60035            foreach (var property in element.EnumerateObject())
 36            {
 20037                if (property.NameEquals("vmSize"))
 38                {
 10039                    if (property.Value.ValueKind == JsonValueKind.Null)
 40                    {
 41                        continue;
 42                    }
 10043                    vmSize = property.Value.GetString();
 10044                    continue;
 45                }
 10046                if (property.NameEquals("count"))
 47                {
 10048                    if (property.Value.ValueKind == JsonValueKind.Null)
 49                    {
 50                        continue;
 51                    }
 10052                    count = property.Value.GetDouble();
 53                    continue;
 54                }
 55            }
 10056            return new DedicatedHostAllocatableVM(vmSize, count);
 57        }
 58    }
 59}