< Summary

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

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualHardDisk.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 uri of a disk. </summary>
 11    public partial class VirtualHardDisk
 12    {
 13        /// <summary> Initializes a new instance of VirtualHardDisk. </summary>
 11614        public VirtualHardDisk()
 15        {
 11616        }
 17
 18        /// <summary> Initializes a new instance of VirtualHardDisk. </summary>
 19        /// <param name="uri"> Specifies the virtual hard disk&apos;s uri. </param>
 34820        internal VirtualHardDisk(string uri)
 21        {
 34822            Uri = uri;
 34823        }
 24
 25        /// <summary> Specifies the virtual hard disk&apos;s uri. </summary>
 127226        public string Uri { get; set; }
 27    }
 28}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualHardDisk.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 VirtualHardDisk : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 26017            writer.WriteStartObject();
 26018            if (Uri != null)
 19            {
 26020                writer.WritePropertyName("uri");
 26021                writer.WriteStringValue(Uri);
 22            }
 26023            writer.WriteEndObject();
 26024        }
 25
 26        internal static VirtualHardDisk DeserializeVirtualHardDisk(JsonElement element)
 27        {
 34828            string uri = default;
 139229            foreach (var property in element.EnumerateObject())
 30            {
 34831                if (property.NameEquals("uri"))
 32                {
 34833                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 34837                    uri = property.Value.GetString();
 38                    continue;
 39                }
 40            }
 34841            return new VirtualHardDisk(uri);
 42        }
 43    }
 44}