< Summary

Class:Azure.ResourceManager.Network.Models.NextHopParameters
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NextHopParameters.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NextHopParameters.Serialization.cs
Covered lines:21
Uncovered lines:12
Coverable lines:33
Total lines:93
Line coverage:63.6% (21 of 33)
Covered branches:4
Total branches:8
Branch coverage:50% (4 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-72.73%50%
.ctor(...)-0%100%
get_TargetResourceId()-100%100%
get_SourceIPAddress()-100%100%
get_DestinationIPAddress()-100%100%
get_TargetNicResourceId()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-83.33%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NextHopParameters.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 and destination endpoint. </summary>
 13    public partial class NextHopParameters
 14    {
 15        /// <summary> Initializes a new instance of NextHopParameters. </summary>
 16        /// <param name="targetResourceId"> The resource identifier of the target resource against which the action is t
 17        /// <param name="sourceIPAddress"> The source IP address. </param>
 18        /// <param name="destinationIPAddress"> The destination IP address. </param>
 819        public NextHopParameters(string targetResourceId, string sourceIPAddress, string destinationIPAddress)
 20        {
 821            if (targetResourceId == null)
 22            {
 023                throw new ArgumentNullException(nameof(targetResourceId));
 24            }
 825            if (sourceIPAddress == null)
 26            {
 027                throw new ArgumentNullException(nameof(sourceIPAddress));
 28            }
 829            if (destinationIPAddress == null)
 30            {
 031                throw new ArgumentNullException(nameof(destinationIPAddress));
 32            }
 33
 834            TargetResourceId = targetResourceId;
 835            SourceIPAddress = sourceIPAddress;
 836            DestinationIPAddress = destinationIPAddress;
 837        }
 38
 39        /// <summary> Initializes a new instance of NextHopParameters. </summary>
 40        /// <param name="targetResourceId"> The resource identifier of the target resource against which the action is t
 41        /// <param name="sourceIPAddress"> The source IP address. </param>
 42        /// <param name="destinationIPAddress"> The destination IP address. </param>
 43        /// <param name="targetNicResourceId"> The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any 
 044        internal NextHopParameters(string targetResourceId, string sourceIPAddress, string destinationIPAddress, string 
 45        {
 046            TargetResourceId = targetResourceId;
 047            SourceIPAddress = sourceIPAddress;
 048            DestinationIPAddress = destinationIPAddress;
 049            TargetNicResourceId = targetNicResourceId;
 050        }
 51
 52        /// <summary> The resource identifier of the target resource against which the action is to be performed. </summ
 1653        public string TargetResourceId { get; }
 54        /// <summary> The source IP address. </summary>
 1655        public string SourceIPAddress { get; }
 56        /// <summary> The destination IP address. </summary>
 1657        public string DestinationIPAddress { get; }
 58        /// <summary> The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this pa
 059        public string TargetNicResourceId { get; set; }
 60    }
 61}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NextHopParameters.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 NextHopParameters : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 1617            writer.WriteStartObject();
 1618            writer.WritePropertyName("targetResourceId");
 1619            writer.WriteStringValue(TargetResourceId);
 1620            writer.WritePropertyName("sourceIPAddress");
 1621            writer.WriteStringValue(SourceIPAddress);
 1622            writer.WritePropertyName("destinationIPAddress");
 1623            writer.WriteStringValue(DestinationIPAddress);
 1624            if (TargetNicResourceId != null)
 25            {
 026                writer.WritePropertyName("targetNicResourceId");
 027                writer.WriteStringValue(TargetNicResourceId);
 28            }
 1629            writer.WriteEndObject();
 1630        }
 31    }
 32}