public void UnwrapsConnectionTuneMethodFrame()
        {
            var message = new ConnectionTune(
                channelMax: Random.UShort(),
                frameMax: Random.UInt(),
                heartbeat: Random.UShort()
                );

            _context.Send(_subject, (Inbound, RawFrame.Wrap(_channelNumber, message)));

            if (_messageReceivedSignal.Wait(timeout: TimeSpan.FromMilliseconds(100)))
            {
                var unwrappedMessage = _unwrappedMessage as ConnectionTune;
                Assert.Equal(expected: message.ChannelMax, actual: unwrappedMessage.ChannelMax);
                Assert.Equal(expected: message.FrameMax, actual: unwrappedMessage.FrameMax);
                Assert.Equal(expected: message.Heartbeat, actual: unwrappedMessage.Heartbeat);
            }
            else
            {
                // No `ConnectionTune` command was received within 100 millis...
                throw new TimeoutException("Timeout occurred before command was received");
            }
        }
示例#2
0
 public virtual void ConnectionTune(C context, ConnectionTune mystruct)
 {
 }