< Summary

Class:Azure.ResourceManager.Compute.Models.DiffDiskSettings
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\DiffDiskSettings.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\DiffDiskSettings.Serialization.cs
Covered lines:24
Uncovered lines:5
Coverable lines:29
Total lines:92
Line coverage:82.7% (24 of 29)
Covered branches:10
Total branches:14
Branch coverage:71.4% (10 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Option()-100%100%
get_Placement()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-77.78%75%
DeserializeDiffDiskSettings(...)-72.73%70%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\DiffDiskSettings.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> Describes the parameters of ephemeral disk settings that can be specified for operating system disk. &
 11    public partial class DiffDiskSettings
 12    {
 13        /// <summary> Initializes a new instance of DiffDiskSettings. </summary>
 414        public DiffDiskSettings()
 15        {
 416            Option = "Local";
 417        }
 18
 19        /// <summary> Initializes a new instance of DiffDiskSettings. </summary>
 20        /// <param name="option"> Specifies the ephemeral disk settings for operating system disk. </param>
 21        /// <param name="placement"> Specifies the ephemeral disk placement for operating system disk.&lt;br&gt;&lt;br&g
 1622        internal DiffDiskSettings(string option, DiffDiskPlacement? placement)
 23        {
 1624            Option = option;
 1625            Placement = placement;
 1626        }
 27
 28        /// <summary> Specifies the ephemeral disk settings for operating system disk. </summary>
 4029        public string Option { get; set; }
 30        /// <summary> Specifies the ephemeral disk placement for operating system disk.&lt;br&gt;&lt;br&gt; Possible val
 2431        public DiffDiskPlacement? Placement { get; set; }
 32    }
 33}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\DiffDiskSettings.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 DiffDiskSettings : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 817            writer.WriteStartObject();
 818            if (Option != null)
 19            {
 820                writer.WritePropertyName("option");
 821                writer.WriteStringValue(Option);
 22            }
 823            if (Placement != null)
 24            {
 025                writer.WritePropertyName("placement");
 026                writer.WriteStringValue(Placement.Value.ToString());
 27            }
 828            writer.WriteEndObject();
 829        }
 30
 31        internal static DiffDiskSettings DeserializeDiffDiskSettings(JsonElement element)
 32        {
 1633            string option = default;
 1634            DiffDiskPlacement? placement = default;
 6435            foreach (var property in element.EnumerateObject())
 36            {
 1637                if (property.NameEquals("option"))
 38                {
 1639                    if (property.Value.ValueKind == JsonValueKind.Null)
 40                    {
 41                        continue;
 42                    }
 1643                    option = property.Value.GetString();
 1644                    continue;
 45                }
 046                if (property.NameEquals("placement"))
 47                {
 048                    if (property.Value.ValueKind == JsonValueKind.Null)
 49                    {
 50                        continue;
 51                    }
 052                    placement = new DiffDiskPlacement(property.Value.GetString());
 53                    continue;
 54                }
 55            }
 1656            return new DiffDiskSettings(option, placement);
 57        }
 58    }
 59}