Exemplo n.º 1
0
        public void MovementMessageEncoding()
        {
            MovementEventMessage originalMessage = new MovementEventMessage();

            originalMessage.ObjectIndex   = 1;
            originalMessage.Location.X    = 1; originalMessage.Location.Y = 2; originalMessage.Location.Z = 3;
            originalMessage.Orientation.X = 10; originalMessage.Orientation.Y = 11; originalMessage.Orientation.Z = 12; originalMessage.Orientation.W = 13;

            byte[] encodedBytes = new byte[originalMessage.FrameDataSize(0)];

            int dataLength = originalMessage.EncodeFrameData(0, encodedBytes, 0);

            MovementEventMessage decodedMessage = new MovementEventMessage();

            decodedMessage.DecodeFrameData(0, encodedBytes, 0, dataLength);



            decodedMessage.MessageId = originalMessage.MessageId;


            String originalMessageString = originalMessage.ToString();
            String decodedMessageString  = decodedMessage.ToString();

            Assert.AreEqual(originalMessageString, decodedMessageString);
        }
Exemplo n.º 2
0
        public void MovementMessageClear()
        {
            MovementEventMessage originalMessage = new MovementEventMessage();

            originalMessage.ObjectIndex   = 1;
            originalMessage.Location.X    = 1; originalMessage.Location.Y = 2; originalMessage.Location.Z = 3;
            originalMessage.Orientation.X = 10; originalMessage.Orientation.Y = 11; originalMessage.Orientation.Z = 12; originalMessage.Orientation.W = 13;

            originalMessage.Clear();
            MovementEventMessage emptyMessage = new MovementEventMessage();

            emptyMessage.MessageId = originalMessage.MessageId;
            Assert.AreEqual(originalMessage.ToString(), emptyMessage.ToString());
        }