< Summary - Combined Code Coverage

Information
Class: NLightning.Transport.Ipc.MessagePack.Formatters.ChannelIdFormatter
Assembly: NLightning.Transport.Ipc
File(s): /home/runner/work/NLightning/NLightning/src/NLightning.Transport.Ipc/MessagePack/Formatters/ChannelIdFormatter.cs
Tag: 57_24045730253
Line coverage
0%
Covered lines: 0
Uncovered lines: 7
Coverable lines: 7
Total lines: 21
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Serialize(...)100%210%
Serialize(...)100%210%
Deserialize(...)0%2040%
Deserialize(...)0%2040%

File(s)

/home/runner/work/NLightning/NLightning/src/NLightning.Transport.Ipc/MessagePack/Formatters/ChannelIdFormatter.cs

#LineLine coverage
 1using System.Runtime.Serialization;
 2using MessagePack;
 3using MessagePack.Formatters;
 4
 5namespace NLightning.Transport.Ipc.MessagePack.Formatters;
 6
 7using Domain.Channels.ValueObjects;
 8
 9public class ChannelIdFormatter : IMessagePackFormatter<ChannelId>
 10{
 11    public void Serialize(ref MessagePackWriter writer, ChannelId value, MessagePackSerializerOptions options)
 012    {
 013        writer.Write((byte[])value);
 014    }
 15
 16    public ChannelId Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options)
 017    {
 018        return reader.ReadBytes()?.FirstSpan.ToArray() ??
 019               throw new SerializationException($"Error deserializing {nameof(ChannelId)})");
 020    }
 21}