public void Can_deliver_messages() { Metrics.P2PBytesSent = 0; Session session = new(30312, new Node(TestItem.PublicKeyA, "127.0.0.1", 8545), _channel, NullDisconnectsAnalyzer.Instance, LimboLogs.Instance); session.Handshake(TestItem.PublicKeyA); session.Init(5, _channelHandlerContext, _packetSender); IProtocolHandler p2p = BuildHandler("p2p", 10); IProtocolHandler aaa = BuildHandler("aaa", 10); IProtocolHandler bbb = BuildHandler("bbb", 5); IProtocolHandler ccc = BuildHandler("ccc", 1); session.AddProtocolHandler(p2p); session.AddProtocolHandler(aaa); session.AddProtocolHandler(bbb); session.AddProtocolHandler(ccc); _packetSender.Enqueue(PingMessage.Instance).Returns(10); session.DeliverMessage(PingMessage.Instance); _packetSender.Received().Enqueue(PingMessage.Instance); Metrics.P2PBytesSent.Should().Be(10); }