< Summary

Class:Azure.ResourceManager.Compute.Models.BillingProfile
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\BillingProfile.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\BillingProfile.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_MaxPrice()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeBillingProfile(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\BillingProfile.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 billing related details of a Azure Spot VM or VMSS. &lt;br&gt;&lt;br&gt;Minimum api-vers
 11    public partial class BillingProfile
 12    {
 13        /// <summary> Initializes a new instance of BillingProfile. </summary>
 1214        public BillingProfile()
 15        {
 1216        }
 17
 18        /// <summary> Initializes a new instance of BillingProfile. </summary>
 19        /// <param name="maxPrice"> Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This pr
 6820        internal BillingProfile(double? maxPrice)
 21        {
 6822            MaxPrice = maxPrice;
 6823        }
 24
 25        /// <summary> Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US D
 12826        public double? MaxPrice { get; set; }
 27    }
 28}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\BillingProfile.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 BillingProfile : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 2417            writer.WriteStartObject();
 2418            if (MaxPrice != null)
 19            {
 2420                writer.WritePropertyName("maxPrice");
 2421                writer.WriteNumberValue(MaxPrice.Value);
 22            }
 2423            writer.WriteEndObject();
 2424        }
 25
 26        internal static BillingProfile DeserializeBillingProfile(JsonElement element)
 27        {
 6828            double? maxPrice = default;
 27229            foreach (var property in element.EnumerateObject())
 30            {
 6831                if (property.NameEquals("maxPrice"))
 32                {
 6833                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 6837                    maxPrice = property.Value.GetDouble();
 38                    continue;
 39                }
 40            }
 6841            return new BillingProfile(maxPrice);
 42        }
 43    }
 44}