< Summary - Combined Code Coverage

Information
Class: NLightning.Tests.Utils.Mocks.FakeSha256
Assembly: NLightning.Tests.Utils
File(s): /home/runner/work/nlightning/nlightning/test/NLightning.Tests.Utils/Mocks/FakeSha256.cs
Tag: 36_15743069263
Line coverage
71%
Covered lines: 5
Uncovered lines: 2
Coverable lines: 7
Total lines: 27
Line coverage: 71.4%
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
AppendData(...)100%11100%
GetHashAndReset(...)100%11100%
GetHashAndReset()100%11100%
Dispose()100%210%

File(s)

/home/runner/work/nlightning/nlightning/test/NLightning.Tests.Utils/Mocks/FakeSha256.cs

#LineLine coverage
 1using NLightning.Domain.Crypto.Hashes;
 2using NLightning.Tests.Utils.Mocks.Interfaces;
 3
 4namespace NLightning.Tests.Utils.Mocks;
 5
 6public class FakeSha256 : ISha256, ITestSha256
 7{
 8    public void AppendData(ReadOnlySpan<byte> data)
 9    {
 15210    }
 11
 12    public void GetHashAndReset(Span<byte> hash)
 13    {
 7614        var result = GetHashAndReset();
 7615        result.CopyTo(hash);
 7616    }
 17
 18    public virtual byte[] GetHashAndReset()
 19    {
 4420        return new byte[32];
 21    }
 22
 23    public void Dispose()
 24    {
 025        GC.SuppressFinalize(this);
 026    }
 27}