< Summary

Class:Azure.ResourceManager.Resources.Models.Dependency
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Dependency.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Dependency.Serialization.cs
Covered lines:31
Uncovered lines:7
Coverable lines:38
Total lines:118
Line coverage:81.5% (31 of 38)
Covered branches:21
Total branches:22
Branch coverage:95.4% (21 of 22)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_DependsOn()-0%100%
get_Id()-0%100%
get_ResourceType()-0%100%
get_ResourceName()-0%100%
DeserializeDependency(...)-96.15%95.45%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Dependency.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.Collections.Generic;
 9
 10namespace Azure.ResourceManager.Resources.Models
 11{
 12    /// <summary> Deployment dependency information. </summary>
 13    public partial class Dependency
 14    {
 15        /// <summary> Initializes a new instance of Dependency. </summary>
 016        internal Dependency()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of Dependency. </summary>
 21        /// <param name="dependsOn"> The list of dependencies. </param>
 22        /// <param name="id"> The ID of the dependency. </param>
 23        /// <param name="resourceType"> The dependency resource type. </param>
 24        /// <param name="resourceName"> The dependency resource name. </param>
 8425        internal Dependency(IReadOnlyList<BasicDependency> dependsOn, string id, string resourceType, string resourceNam
 26        {
 8427            DependsOn = dependsOn;
 8428            Id = id;
 8429            ResourceType = resourceType;
 8430            ResourceName = resourceName;
 8431        }
 32
 33        /// <summary> The list of dependencies. </summary>
 034        public IReadOnlyList<BasicDependency> DependsOn { get; }
 35        /// <summary> The ID of the dependency. </summary>
 036        public string Id { get; }
 37        /// <summary> The dependency resource type. </summary>
 038        public string ResourceType { get; }
 39        /// <summary> The dependency resource name. </summary>
 040        public string ResourceName { get; }
 41    }
 42}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Dependency.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.ResourceManager.Resources.Models
 13{
 14    public partial class Dependency
 15    {
 16        internal static Dependency DeserializeDependency(JsonElement element)
 17        {
 8418            IReadOnlyList<BasicDependency> dependsOn = default;
 8419            string id = default;
 8420            string resourceType = default;
 8421            string resourceName = default;
 84022            foreach (var property in element.EnumerateObject())
 23            {
 33624                if (property.NameEquals("dependsOn"))
 25                {
 8426                    if (property.Value.ValueKind == JsonValueKind.Null)
 27                    {
 28                        continue;
 29                    }
 8430                    List<BasicDependency> array = new List<BasicDependency>();
 33631                    foreach (var item in property.Value.EnumerateArray())
 32                    {
 8433                        if (item.ValueKind == JsonValueKind.Null)
 34                        {
 035                            array.Add(null);
 36                        }
 37                        else
 38                        {
 8439                            array.Add(BasicDependency.DeserializeBasicDependency(item));
 40                        }
 41                    }
 8442                    dependsOn = array;
 8443                    continue;
 44                }
 25245                if (property.NameEquals("id"))
 46                {
 8447                    if (property.Value.ValueKind == JsonValueKind.Null)
 48                    {
 49                        continue;
 50                    }
 8451                    id = property.Value.GetString();
 8452                    continue;
 53                }
 16854                if (property.NameEquals("resourceType"))
 55                {
 8456                    if (property.Value.ValueKind == JsonValueKind.Null)
 57                    {
 58                        continue;
 59                    }
 8460                    resourceType = property.Value.GetString();
 8461                    continue;
 62                }
 8463                if (property.NameEquals("resourceName"))
 64                {
 8465                    if (property.Value.ValueKind == JsonValueKind.Null)
 66                    {
 67                        continue;
 68                    }
 8469                    resourceName = property.Value.GetString();
 70                    continue;
 71                }
 72            }
 8473            return new Dependency(dependsOn, id, resourceType, resourceName);
 74        }
 75    }
 76}