< Summary

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

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ApiEntityReference.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 API entity reference. </summary>
 11    public partial class ApiEntityReference
 12    {
 13        /// <summary> Initializes a new instance of ApiEntityReference. </summary>
 17214        public ApiEntityReference()
 15        {
 17216        }
 17
 18        /// <summary> Initializes a new instance of ApiEntityReference. </summary>
 19        /// <param name="id"> The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{Resourc
 59620        internal ApiEntityReference(string id)
 21        {
 59622            Id = id;
 59623        }
 24
 25        /// <summary> The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupNa
 160826        public string Id { get; set; }
 27    }
 28}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ApiEntityReference.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 ApiEntityReference : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 42017            writer.WriteStartObject();
 42018            if (Id != null)
 19            {
 42020                writer.WritePropertyName("id");
 42021                writer.WriteStringValue(Id);
 22            }
 42023            writer.WriteEndObject();
 42024        }
 25
 26        internal static ApiEntityReference DeserializeApiEntityReference(JsonElement element)
 27        {
 59628            string id = default;
 238429            foreach (var property in element.EnumerateObject())
 30            {
 59631                if (property.NameEquals("id"))
 32                {
 59633                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 59637                    id = property.Value.GetString();
 38                    continue;
 39                }
 40            }
 59641            return new ApiEntityReference(id);
 42        }
 43    }
 44}