< Summary

Class:Azure.ResourceManager.Network.Models.Topology
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\Topology.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\Topology.Serialization.cs
Covered lines:32
Uncovered lines:6
Coverable lines:38
Total lines:120
Line coverage:84.2% (32 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_Id()-0%100%
get_CreatedDateTime()-0%100%
get_LastModified()-0%100%
get_Resources()-100%100%
DeserializeTopology(...)-96.15%95.45%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\Topology.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;
 9using System.Collections.Generic;
 10
 11namespace Azure.ResourceManager.Network.Models
 12{
 13    /// <summary> Topology of the specified resource group. </summary>
 14    public partial class Topology
 15    {
 16        /// <summary> Initializes a new instance of Topology. </summary>
 017        internal Topology()
 18        {
 019        }
 20
 21        /// <summary> Initializes a new instance of Topology. </summary>
 22        /// <param name="id"> GUID representing the operation id. </param>
 23        /// <param name="createdDateTime"> The datetime when the topology was initially created for the resource group. 
 24        /// <param name="lastModified"> The datetime when the topology was last modified. </param>
 25        /// <param name="resources"> A list of topology resources. </param>
 426        internal Topology(string id, DateTimeOffset? createdDateTime, DateTimeOffset? lastModified, IReadOnlyList<Topolo
 27        {
 428            Id = id;
 429            CreatedDateTime = createdDateTime;
 430            LastModified = lastModified;
 431            Resources = resources;
 432        }
 33
 34        /// <summary> GUID representing the operation id. </summary>
 035        public string Id { get; }
 36        /// <summary> The datetime when the topology was initially created for the resource group. </summary>
 037        public DateTimeOffset? CreatedDateTime { get; }
 38        /// <summary> The datetime when the topology was last modified. </summary>
 039        public DateTimeOffset? LastModified { get; }
 40        /// <summary> A list of topology resources. </summary>
 841        public IReadOnlyList<TopologyResource> Resources { get; }
 42    }
 43}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\Topology.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;
 9using System.Collections.Generic;
 10using System.Text.Json;
 11using Azure.Core;
 12
 13namespace Azure.ResourceManager.Network.Models
 14{
 15    public partial class Topology
 16    {
 17        internal static Topology DeserializeTopology(JsonElement element)
 18        {
 419            string id = default;
 420            DateTimeOffset? createdDateTime = default;
 421            DateTimeOffset? lastModified = default;
 422            IReadOnlyList<TopologyResource> resources = default;
 4023            foreach (var property in element.EnumerateObject())
 24            {
 1625                if (property.NameEquals("id"))
 26                {
 427                    if (property.Value.ValueKind == JsonValueKind.Null)
 28                    {
 29                        continue;
 30                    }
 431                    id = property.Value.GetString();
 432                    continue;
 33                }
 1234                if (property.NameEquals("createdDateTime"))
 35                {
 436                    if (property.Value.ValueKind == JsonValueKind.Null)
 37                    {
 38                        continue;
 39                    }
 440                    createdDateTime = property.Value.GetDateTimeOffset("O");
 441                    continue;
 42                }
 843                if (property.NameEquals("lastModified"))
 44                {
 445                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 449                    lastModified = property.Value.GetDateTimeOffset("O");
 450                    continue;
 51                }
 452                if (property.NameEquals("resources"))
 53                {
 454                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 458                    List<TopologyResource> array = new List<TopologyResource>();
 8059                    foreach (var item in property.Value.EnumerateArray())
 60                    {
 3661                        if (item.ValueKind == JsonValueKind.Null)
 62                        {
 063                            array.Add(null);
 64                        }
 65                        else
 66                        {
 3667                            array.Add(TopologyResource.DeserializeTopologyResource(item));
 68                        }
 69                    }
 470                    resources = array;
 71                    continue;
 72                }
 73            }
 474            return new Topology(id, createdDateTime, lastModified, resources);
 75        }
 76    }
 77}