< Summary

Class:Azure.ResourceManager.Compute.Models.SubResourceWithColocationStatus
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SubResourceWithColocationStatus.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SubResourceWithColocationStatus.Serialization.cs
Covered lines:11
Uncovered lines:15
Coverable lines:26
Total lines:88
Line coverage:42.3% (11 of 26)
Covered branches:8
Total branches:14
Branch coverage:57.1% (8 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_ColocationStatus()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeSubResourceWithColocationStatus(...)-72.73%80%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SubResourceWithColocationStatus.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> The SubResourceWithColocationStatus. </summary>
 11    public partial class SubResourceWithColocationStatus : SubResource
 12    {
 13        /// <summary> Initializes a new instance of SubResourceWithColocationStatus. </summary>
 014        public SubResourceWithColocationStatus()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of SubResourceWithColocationStatus. </summary>
 19        /// <param name="id"> Resource Id. </param>
 20        /// <param name="colocationStatus"> Describes colocation status of a resource in the Proximity Placement Group. 
 421        internal SubResourceWithColocationStatus(string id, InstanceViewStatus colocationStatus) : base(id)
 22        {
 423            ColocationStatus = colocationStatus;
 424        }
 25
 26        /// <summary> Describes colocation status of a resource in the Proximity Placement Group. </summary>
 027        public InstanceViewStatus ColocationStatus { get; set; }
 28    }
 29}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\SubResourceWithColocationStatus.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 SubResourceWithColocationStatus : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (ColocationStatus != null)
 19            {
 020                writer.WritePropertyName("colocationStatus");
 021                writer.WriteObjectValue(ColocationStatus);
 22            }
 023            if (Id != null)
 24            {
 025                writer.WritePropertyName("id");
 026                writer.WriteStringValue(Id);
 27            }
 028            writer.WriteEndObject();
 029        }
 30
 31        internal static SubResourceWithColocationStatus DeserializeSubResourceWithColocationStatus(JsonElement element)
 32        {
 433            InstanceViewStatus colocationStatus = default;
 434            string id = default;
 1635            foreach (var property in element.EnumerateObject())
 36            {
 437                if (property.NameEquals("colocationStatus"))
 38                {
 039                    if (property.Value.ValueKind == JsonValueKind.Null)
 40                    {
 41                        continue;
 42                    }
 043                    colocationStatus = InstanceViewStatus.DeserializeInstanceViewStatus(property.Value);
 044                    continue;
 45                }
 446                if (property.NameEquals("id"))
 47                {
 448                    if (property.Value.ValueKind == JsonValueKind.Null)
 49                    {
 50                        continue;
 51                    }
 452                    id = property.Value.GetString();
 53                    continue;
 54                }
 55            }
 456            return new SubResourceWithColocationStatus(id, colocationStatus);
 57        }
 58    }
 59}