< Summary

Class:Azure.ResourceManager.Compute.Models.OSDiskImage
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\OSDiskImage.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\OSDiskImage.Serialization.cs
Covered lines:9
Uncovered lines:5
Coverable lines:14
Total lines:60
Line coverage:64.2% (9 of 14)
Covered branches:4
Total branches:4
Branch coverage:100% (4 of 4)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
get_OperatingSystem()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%100%
DeserializeOSDiskImage(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\OSDiskImage.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> Contains the os disk image information. </summary>
 11    public partial class OSDiskImage
 12    {
 13        /// <summary> Initializes a new instance of OSDiskImage. </summary>
 14        /// <param name="operatingSystem"> The operating system of the osDiskImage. </param>
 3215        public OSDiskImage(OperatingSystemTypes operatingSystem)
 16        {
 3217            OperatingSystem = operatingSystem;
 3218        }
 19
 20        /// <summary> The operating system of the osDiskImage. </summary>
 3621        public OperatingSystemTypes OperatingSystem { get; set; }
 22    }
 23}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\OSDiskImage.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 OSDiskImage : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("operatingSystem");
 019            writer.WriteStringValue(OperatingSystem.ToSerialString());
 020            writer.WriteEndObject();
 021        }
 22
 23        internal static OSDiskImage DeserializeOSDiskImage(JsonElement element)
 24        {
 3225            OperatingSystemTypes operatingSystem = default;
 25626            foreach (var property in element.EnumerateObject())
 27            {
 9628                if (property.NameEquals("operatingSystem"))
 29                {
 3230                    operatingSystem = property.Value.GetString().ToOperatingSystemTypes();
 31                    continue;
 32                }
 33            }
 3234            return new OSDiskImage(operatingSystem);
 35        }
 36    }
 37}