< Summary

Class:Azure.ResourceManager.Network.Models.SubResource
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\SubResource.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\SubResource.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%
DeserializeSubResource(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\SubResource.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.Network.Models
 9{
 10    /// <summary> Reference to another subresource. </summary>
 11    public partial class SubResource
 12    {
 13        /// <summary> Initializes a new instance of SubResource. </summary>
 72814        public SubResource()
 15        {
 72816        }
 17
 18        /// <summary> Initializes a new instance of SubResource. </summary>
 19        /// <param name="id"> Resource ID. </param>
 622820        internal SubResource(string id)
 21        {
 622822            Id = id;
 622823        }
 24
 25        /// <summary> Resource ID. </summary>
 1046026        public string Id { get; set; }
 27    }
 28}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\SubResource.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.Network.Models
 12{
 13    public partial class SubResource : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 67217            writer.WriteStartObject();
 67218            if (Id != null)
 19            {
 67220                writer.WritePropertyName("id");
 67221                writer.WriteStringValue(Id);
 22            }
 67223            writer.WriteEndObject();
 67224        }
 25
 26        internal static SubResource DeserializeSubResource(JsonElement element)
 27        {
 125228            string id = default;
 500829            foreach (var property in element.EnumerateObject())
 30            {
 125231                if (property.NameEquals("id"))
 32                {
 125233                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 125237                    id = property.Value.GetString();
 38                    continue;
 39                }
 40            }
 125241            return new SubResource(id);
 42        }
 43    }
 44}