< Summary - Combined Code Coverage

Information
Class: NLightning.Domain.Protocol.Payloads.PongPayload
Assembly: NLightning.Domain
File(s): /home/runner/work/nlightning/nlightning/src/NLightning.Domain/Protocol/Payloads/PongPayload.cs
Tag: 30_15166811759
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 33
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_BytesLength()100%11100%
get_Ignored()100%11100%
.ctor(...)100%11100%

File(s)

/home/runner/work/nlightning/nlightning/src/NLightning.Domain/Protocol/Payloads/PongPayload.cs

#LineLine coverage
 1namespace NLightning.Domain.Protocol.Payloads;
 2
 3using Interfaces;
 4using Messages;
 5
 6/// <summary>
 7/// Represents a Pong payload.
 8/// </summary>
 9/// <remarks>
 10/// A Pong payload is used to respond to a Ping payload.
 11/// </remarks>
 12/// <seealso cref="PongMessage"/>
 13public class PongPayload : IMessagePayload
 14{
 15    /// <summary>
 16    /// The length of the ignored bytes.
 17    /// </summary>
 2018    public ushort BytesLength { get; }
 19
 20    /// <summary>
 21    /// The ignored bytes.
 22    /// </summary>
 6423    public byte[] Ignored { get; internal init; }
 24
 2825    public PongPayload(ushort bytesLen)
 26    {
 2827        BytesLength = bytesLen;
 2828        Ignored = new byte[bytesLen];
 29
 30        // Fill the ignored bytes with random data
 2831        new Random().NextBytes(Ignored);
 2832    }
 33}