< Summary - Combined Code Coverage

Information
Class: NLightning.Infrastructure.Node.ValueObjects.ConnectedPeer
Assembly: NLightning.Infrastructure
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Infrastructure/Node/ValueObjects/ConnectedPeer.cs
Tag: 36_15743069263
Line coverage
100%
Covered lines: 9
Uncovered lines: 0
Coverable lines: 9
Total lines: 41
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_CompactPubKey()100%11100%
get_Host()100%11100%
get_Port()100%11100%
get_TcpClient()100%11100%
.ctor(...)100%11100%

File(s)

/home/runner/work/nlightning/nlightning/src/NLightning.Infrastructure/Node/ValueObjects/ConnectedPeer.cs

#LineLine coverage
 1using System.Net.Sockets;
 2
 3namespace NLightning.Infrastructure.Node.ValueObjects;
 4
 5using Domain.Crypto.ValueObjects;
 6
 7public readonly record struct ConnectedPeer
 8{
 9    /// <summary>
 10    /// The public key of the peer we are connected to.
 11    /// </summary>
 1212    public CompactPubKey CompactPubKey { get; }
 13
 14    /// <summary>
 15    /// The host address of the connected peer.
 16    /// </summary>
 417    public string Host { get; }
 18
 19    /// <summary>
 20    /// The port used by the peer to establish the connection.
 21    /// </summary>
 422    public uint Port { get; }
 23
 24    /// <summary>
 25    /// The TCP client representing the connection to the peer.
 26    /// </summary>
 427    public TcpClient TcpClient { get; }
 28
 29    /// <summary>
 30    /// Represents a connected peer in the network, consisting of a compact public key and a TCP client.
 31    /// </summary>
 32    /// <param name="compactPubKey">The compact public key of the peer.</param>
 33    /// <param name="tcpClient">The TCP client representing the connection to the peer.</param>
 34    public ConnectedPeer(CompactPubKey compactPubKey, string host, uint port, TcpClient tcpClient)
 35    {
 436        CompactPubKey = compactPubKey;
 437        Host = host;
 438        Port = port;
 439        TcpClient = tcpClient;
 440    }
 41}