< Summary

Class:Azure.ResourceManager.Network.Models.ConnectionMonitorSource
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionMonitorSource.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionMonitorSource.Serialization.cs
Covered lines:0
Uncovered lines:29
Coverable lines:29
Total lines:93
Line coverage:0% (0 of 29)
Covered branches:0
Total branches:12
Branch coverage:0% (0 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_ResourceId()-0%100%
get_Port()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeConnectionMonitorSource(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionMonitorSource.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;
 9
 10namespace Azure.ResourceManager.Network.Models
 11{
 12    /// <summary> Describes the source of connection monitor. </summary>
 13    public partial class ConnectionMonitorSource
 14    {
 15        /// <summary> Initializes a new instance of ConnectionMonitorSource. </summary>
 16        /// <param name="resourceId"> The ID of the resource used as the source by connection monitor. </param>
 017        public ConnectionMonitorSource(string resourceId)
 18        {
 019            if (resourceId == null)
 20            {
 021                throw new ArgumentNullException(nameof(resourceId));
 22            }
 23
 024            ResourceId = resourceId;
 025        }
 26
 27        /// <summary> Initializes a new instance of ConnectionMonitorSource. </summary>
 28        /// <param name="resourceId"> The ID of the resource used as the source by connection monitor. </param>
 29        /// <param name="port"> The source port used by connection monitor. </param>
 030        internal ConnectionMonitorSource(string resourceId, int? port)
 31        {
 032            ResourceId = resourceId;
 033            Port = port;
 034        }
 35
 36        /// <summary> The ID of the resource used as the source by connection monitor. </summary>
 037        public string ResourceId { get; set; }
 38        /// <summary> The source port used by connection monitor. </summary>
 039        public int? Port { get; set; }
 40    }
 41}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectionMonitorSource.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.Network.Models
 12{
 13    public partial class ConnectionMonitorSource : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("resourceId");
 019            writer.WriteStringValue(ResourceId);
 020            if (Port != null)
 21            {
 022                writer.WritePropertyName("port");
 023                writer.WriteNumberValue(Port.Value);
 24            }
 025            writer.WriteEndObject();
 026        }
 27
 28        internal static ConnectionMonitorSource DeserializeConnectionMonitorSource(JsonElement element)
 29        {
 030            string resourceId = default;
 031            int? port = default;
 032            foreach (var property in element.EnumerateObject())
 33            {
 034                if (property.NameEquals("resourceId"))
 35                {
 036                    resourceId = property.Value.GetString();
 037                    continue;
 38                }
 039                if (property.NameEquals("port"))
 40                {
 041                    if (property.Value.ValueKind == JsonValueKind.Null)
 42                    {
 43                        continue;
 44                    }
 045                    port = property.Value.GetInt32();
 46                    continue;
 47                }
 48            }
 049            return new ConnectionMonitorSource(resourceId, port);
 50        }
 51    }
 52}