Exemplo n.º 1
0
        public void CorrectMessageShouldParseSuccessfully()
        {
            var message = new ServerResponseDac();
            message.Read(new byte[] {
                0x5, 0x6, 0x0, 0x1, 0x99, 0x5
            });

            Assert.Equal(1433, message.Port);
        }
Exemplo n.º 2
0
        public void ProtocolExample3ShouldParseCorrectly()
        {
            byte[] request = HexStringToArray("0f 01 59 55 4b 4f 4e 53 54 44 00"); // ..YUKONSTD

            var requestMessage = new ClientUnicastDac();
            requestMessage.Read(request);

            Assert.Equal("YUKONSTD", requestMessage.InstanceName);
            Assert.Equal(request, requestMessage.Write());

            byte[] response = HexStringToArray("05 06 00 01 32 df"); // ....2

            var responseMessage = new ServerResponseDac();
            responseMessage.Read(response);

            Assert.Equal(0xdf32, responseMessage.Port);
            Assert.Equal(response, responseMessage.Write());
        }