< Summary

Class:Azure.ResourceManager.Resources.Models.ResourceLink
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ResourceLink.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ResourceLink.Serialization.cs
Covered lines:39
Uncovered lines:9
Coverable lines:48
Total lines:129
Line coverage:81.2% (39 of 48)
Covered branches:21
Total branches:26
Branch coverage:80.7% (21 of 26)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Id()-100%100%
get_Name()-100%100%
get_Type()-100%100%
get_Properties()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-60%62.5%
DeserializeResourceLink(...)-85.71%88.89%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ResourceLink.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.Resources.Models
 9{
 10    /// <summary> The resource link. </summary>
 11    public partial class ResourceLink
 12    {
 13        /// <summary> Initializes a new instance of ResourceLink. </summary>
 414        public ResourceLink()
 15        {
 416        }
 17
 18        /// <summary> Initializes a new instance of ResourceLink. </summary>
 19        /// <param name="id"> The fully qualified ID of the resource link. </param>
 20        /// <param name="name"> The name of the resource link. </param>
 21        /// <param name="type"> The resource link object. </param>
 22        /// <param name="properties"> Properties for resource link. </param>
 2423        internal ResourceLink(string id, string name, object type, ResourceLinkProperties properties)
 24        {
 2425            Id = id;
 2426            Name = name;
 2427            Type = type;
 2428            Properties = properties;
 2429        }
 30
 31        /// <summary> The fully qualified ID of the resource link. </summary>
 2432        public string Id { get; }
 33        /// <summary> The name of the resource link. </summary>
 2434        public string Name { get; }
 35        /// <summary> The resource link object. </summary>
 436        public object Type { get; }
 37        /// <summary> Properties for resource link. </summary>
 9638        public ResourceLinkProperties Properties { get; set; }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ResourceLink.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.Resources.Models
 12{
 13    public partial class ResourceLink : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 417            writer.WriteStartObject();
 418            if (Id != null)
 19            {
 020                writer.WritePropertyName("id");
 021                writer.WriteStringValue(Id);
 22            }
 423            if (Name != null)
 24            {
 025                writer.WritePropertyName("name");
 026                writer.WriteStringValue(Name);
 27            }
 428            if (Type != null)
 29            {
 030                writer.WritePropertyName("type");
 031                writer.WriteObjectValue(Type);
 32            }
 433            if (Properties != null)
 34            {
 435                writer.WritePropertyName("properties");
 436                writer.WriteObjectValue(Properties);
 37            }
 438            writer.WriteEndObject();
 439        }
 40
 41        internal static ResourceLink DeserializeResourceLink(JsonElement element)
 42        {
 2443            string id = default;
 2444            string name = default;
 2445            object type = default;
 2446            ResourceLinkProperties properties = default;
 19247            foreach (var property in element.EnumerateObject())
 48            {
 7249                if (property.NameEquals("id"))
 50                {
 2451                    if (property.Value.ValueKind == JsonValueKind.Null)
 52                    {
 53                        continue;
 54                    }
 2455                    id = property.Value.GetString();
 2456                    continue;
 57                }
 4858                if (property.NameEquals("name"))
 59                {
 2460                    if (property.Value.ValueKind == JsonValueKind.Null)
 61                    {
 62                        continue;
 63                    }
 2464                    name = property.Value.GetString();
 2465                    continue;
 66                }
 2467                if (property.NameEquals("type"))
 68                {
 069                    if (property.Value.ValueKind == JsonValueKind.Null)
 70                    {
 71                        continue;
 72                    }
 073                    type = property.Value.GetObject();
 074                    continue;
 75                }
 2476                if (property.NameEquals("properties"))
 77                {
 2478                    if (property.Value.ValueKind == JsonValueKind.Null)
 79                    {
 80                        continue;
 81                    }
 2482                    properties = ResourceLinkProperties.DeserializeResourceLinkProperties(property.Value);
 83                    continue;
 84                }
 85            }
 2486            return new ResourceLink(id, name, type, properties);
 87        }
 88    }
 89}