< Summary - Combined Code Coverage

Information
Class: NLightning.Domain.Protocol.Messages.InitMessage
Assembly: NLightning.Domain
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Domain/Protocol/Messages/InitMessage.cs
Tag: 36_15743069263
Line coverage
80%
Covered lines: 8
Uncovered lines: 2
Coverable lines: 10
Total lines: 38
Line coverage: 80%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Payload()100%11100%
get_NetworksTlv()100%210%
get_RemoteAddressTlv()100%210%
.ctor(...)100%44100%

File(s)

/home/runner/work/nlightning/nlightning/src/NLightning.Domain/Protocol/Messages/InitMessage.cs

#LineLine coverage
 1namespace NLightning.Domain.Protocol.Messages;
 2
 3using Constants;
 4using Models;
 5using Payloads;
 6using Tlv;
 7
 8/// <summary>
 9/// Represents an init message.
 10/// </summary>
 11/// <remarks>
 12/// The init message is used to communicate the features of the node.
 13/// The message type is 16.
 14/// </remarks>
 15public sealed class InitMessage : BaseMessage
 16{
 17    /// <summary>
 18    /// The payload of the message.
 19    /// </summary>
 820    public new InitPayload Payload { get => (InitPayload)base.Payload; }
 21
 022    public NetworksTlv? NetworksTlv { get; }
 23
 024    public RemoteAddressTlv? RemoteAddressTlv { get; }
 25
 26    public InitMessage(InitPayload payload, NetworksTlv? networksTlv = null, RemoteAddressTlv? remoteAddressTlv = null)
 1627        : base(MessageTypes.Init, payload)
 28    {
 1629        NetworksTlv = networksTlv;
 1630        RemoteAddressTlv = remoteAddressTlv;
 31
 1632        if (networksTlv is not null || remoteAddressTlv is not null)
 33        {
 834            Extension = new TlvStream();
 835            Extension.Add(networksTlv, remoteAddressTlv);
 36        }
 1637    }
 38}