예제 #1
0
        public void ChallengeResponseMessageEncoding()
        {
            ChallengeResponseMessage originalMessage = new ChallengeResponseMessage();

            for (int i = 0; i < originalMessage.ChallengeResponseBytes.Length; i++)
            {
                originalMessage.ChallengeResponseBytes[i] = (byte)i;
            }

            byte[] encodedBytes = new byte[256];

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

            ChallengeResponseMessage decodedMessage = new ChallengeResponseMessage();

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



            decodedMessage.MessageId = originalMessage.MessageId;


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

            Assert.AreEqual(originalMessageString, decodedMessageString);
        }
예제 #2
0
        public void ChallengeResponseMessageClear()
        {
            ChallengeResponseMessage originalMessage = new ChallengeResponseMessage();

            for (int i = 0; i < originalMessage.ChallengeResponseBytes.Length; i++)
            {
                originalMessage.ChallengeResponseBytes[i] = (byte)i;
            }

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

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