< Summary

Class:Azure.ResourceManager.Resources.Models.TargetResource
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\TargetResource.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\TargetResource.Serialization.cs
Covered lines:24
Uncovered lines:2
Coverable lines:26
Total lines:89
Line coverage:92.3% (24 of 26)
Covered branches:14
Total branches:14
Branch coverage:100% (14 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Id()-100%100%
get_ResourceName()-100%100%
get_ResourceType()-100%100%
DeserializeTargetResource(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\TargetResource.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> Target resource. </summary>
 11    public partial class TargetResource
 12    {
 13        /// <summary> Initializes a new instance of TargetResource. </summary>
 014        internal TargetResource()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of TargetResource. </summary>
 19        /// <param name="id"> The ID of the resource. </param>
 20        /// <param name="resourceName"> The name of the resource. </param>
 21        /// <param name="resourceType"> The type of the resource. </param>
 4822        internal TargetResource(string id, string resourceName, string resourceType)
 23        {
 4824            Id = id;
 4825            ResourceName = resourceName;
 4826            ResourceType = resourceType;
 4827        }
 28
 29        /// <summary> The ID of the resource. </summary>
 830        public string Id { get; }
 31        /// <summary> The name of the resource. </summary>
 832        public string ResourceName { get; }
 33        /// <summary> The type of the resource. </summary>
 834        public string ResourceType { get; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\TargetResource.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 TargetResource
 14    {
 15        internal static TargetResource DeserializeTargetResource(JsonElement element)
 16        {
 4817            string id = default;
 4818            string resourceName = default;
 4819            string resourceType = default;
 41620            foreach (var property in element.EnumerateObject())
 21            {
 16022                if (property.NameEquals("id"))
 23                {
 4824                    if (property.Value.ValueKind == JsonValueKind.Null)
 25                    {
 26                        continue;
 27                    }
 4828                    id = property.Value.GetString();
 4829                    continue;
 30                }
 11231                if (property.NameEquals("resourceName"))
 32                {
 4833                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 4837                    resourceName = property.Value.GetString();
 4838                    continue;
 39                }
 6440                if (property.NameEquals("resourceType"))
 41                {
 4842                    if (property.Value.ValueKind == JsonValueKind.Null)
 43                    {
 44                        continue;
 45                    }
 4846                    resourceType = property.Value.GetString();
 47                    continue;
 48                }
 49            }
 4850            return new TargetResource(id, resourceName, resourceType);
 51        }
 52    }
 53}