Exemplo n.º 1
0
        public void GetBytesTest()
        {
            PingMessage message = new PingMessage(5, 10);

            byte[] actual = message.GetBytes();
            Assert.Equal("00120005000a00000000000000000000", actual.ToHex());
        }
Exemplo n.º 2
0
        public void ParseNotSupportedMessageTest()
        {
            TransportState transportState   = new TransportState();
            PingMessage    referenceMessage = new PingMessage(0, 0);
            MessageReader  messageReader    = new MessageReader(transportState, new List <MessageDefinition> {
                InitMessage.MessageDefinition
            }, new List <IMessageValidator>());

            Assert.Throws <MessageNotSupportedException>(() => messageReader.Parse(referenceMessage.GetBytes()));
        }