< Summary

Class:Azure.ResourceManager.Network.Models.ConnectivitySource
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectivitySource.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectivitySource.Serialization.cs
Covered lines:11
Uncovered lines:8
Coverable lines:19
Total lines:69
Line coverage:57.8% (11 of 19)
Covered branches:2
Total branches:4
Branch coverage:50% (2 of 4)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectivitySource.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> Parameters that define the source of the connection. </summary>
 13    public partial class ConnectivitySource
 14    {
 15        /// <summary> Initializes a new instance of ConnectivitySource. </summary>
 16        /// <param name="resourceId"> The ID of the resource from which a connectivity check will be initiated. </param>
 417        public ConnectivitySource(string resourceId)
 18        {
 419            if (resourceId == null)
 20            {
 021                throw new ArgumentNullException(nameof(resourceId));
 22            }
 23
 424            ResourceId = resourceId;
 425        }
 26
 27        /// <summary> Initializes a new instance of ConnectivitySource. </summary>
 28        /// <param name="resourceId"> The ID of the resource from which a connectivity check will be initiated. </param>
 29        /// <param name="port"> The source port from which a connectivity check will be performed. </param>
 030        internal ConnectivitySource(string resourceId, int? port)
 31        {
 032            ResourceId = resourceId;
 033            Port = port;
 034        }
 35
 36        /// <summary> The ID of the resource from which a connectivity check will be initiated. </summary>
 837        public string ResourceId { get; }
 38        /// <summary> The source port from which a connectivity check will be performed. </summary>
 039        public int? Port { get; set; }
 40    }
 41}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ConnectivitySource.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 ConnectivitySource : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 817            writer.WriteStartObject();
 818            writer.WritePropertyName("resourceId");
 819            writer.WriteStringValue(ResourceId);
 820            if (Port != null)
 21            {
 022                writer.WritePropertyName("port");
 023                writer.WriteNumberValue(Port.Value);
 24            }
 825            writer.WriteEndObject();
 826        }
 27    }
 28}