< Summary

Class:Azure.ResourceManager.Resources.Models.ResourceReference
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ResourceReference.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ResourceReference.Serialization.cs
Covered lines:9
Uncovered lines:3
Coverable lines:12
Total lines:61
Line coverage:75% (9 of 12)
Covered branches:6
Total branches:6
Branch coverage:100% (6 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Id()-0%100%
DeserializeResourceReference(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ResourceReference.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 Id model. </summary>
 11    public partial class ResourceReference
 12    {
 13        /// <summary> Initializes a new instance of ResourceReference. </summary>
 014        internal ResourceReference()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of ResourceReference. </summary>
 19        /// <param name="id"> The fully qualified resource Id. </param>
 28020        internal ResourceReference(string id)
 21        {
 28022            Id = id;
 28023        }
 24
 25        /// <summary> The fully qualified resource Id. </summary>
 026        public string Id { get; }
 27    }
 28}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\ResourceReference.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 ResourceReference
 14    {
 15        internal static ResourceReference DeserializeResourceReference(JsonElement element)
 16        {
 28017            string id = default;
 112018            foreach (var property in element.EnumerateObject())
 19            {
 28020                if (property.NameEquals("id"))
 21                {
 28022                    if (property.Value.ValueKind == JsonValueKind.Null)
 23                    {
 24                        continue;
 25                    }
 28026                    id = property.Value.GetString();
 27                    continue;
 28                }
 29            }
 28030            return new ResourceReference(id);
 31        }
 32    }
 33}