< Summary

Class:Azure.ResourceManager.Network.Models.NetworkWatcherListResult
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkWatcherListResult.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkWatcherListResult.Serialization.cs
Covered lines:14
Uncovered lines:3
Coverable lines:17
Total lines:76
Line coverage:82.3% (14 of 17)
Covered branches:9
Total branches:10
Branch coverage:90% (9 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Value()-100%100%
DeserializeNetworkWatcherListResult(...)-90.91%90%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkWatcherListResult.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.Network.Models
 11{
 12    /// <summary> Response for ListNetworkWatchers API service call. </summary>
 13    public partial class NetworkWatcherListResult
 14    {
 15        /// <summary> Initializes a new instance of NetworkWatcherListResult. </summary>
 016        internal NetworkWatcherListResult()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of NetworkWatcherListResult. </summary>
 21        /// <param name="value"> List of network watcher resources. </param>
 1222        internal NetworkWatcherListResult(IReadOnlyList<NetworkWatcher> value)
 23        {
 1224            Value = value;
 1225        }
 26
 27        /// <summary> List of network watcher resources. </summary>
 1228        public IReadOnlyList<NetworkWatcher> Value { get; }
 29    }
 30}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkWatcherListResult.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.Network.Models
 13{
 14    public partial class NetworkWatcherListResult
 15    {
 16        internal static NetworkWatcherListResult DeserializeNetworkWatcherListResult(JsonElement element)
 17        {
 1218            IReadOnlyList<NetworkWatcher> value = default;
 4819            foreach (var property in element.EnumerateObject())
 20            {
 1221                if (property.NameEquals("value"))
 22                {
 1223                    if (property.Value.ValueKind == JsonValueKind.Null)
 24                    {
 25                        continue;
 26                    }
 1227                    List<NetworkWatcher> array = new List<NetworkWatcher>();
 13628                    foreach (var item in property.Value.EnumerateArray())
 29                    {
 5630                        if (item.ValueKind == JsonValueKind.Null)
 31                        {
 032                            array.Add(null);
 33                        }
 34                        else
 35                        {
 5636                            array.Add(NetworkWatcher.DeserializeNetworkWatcher(item));
 37                        }
 38                    }
 1239                    value = array;
 40                    continue;
 41                }
 42            }
 1243            return new NetworkWatcherListResult(value);
 44        }
 45    }
 46}