コード例 #1
0
        public void AcknowledgePrivateMessage_Instantiates_Properly()
        {
            var num = new Random().Next();
            var a   = new AcknowledgePrivateMessageCommand(num);

            Assert.Equal(num, a.Id);
        }
コード例 #2
0
        public void AcknowledgePrivateMessage_Constructs_The_Correct_Message()
        {
            var num = new Random().Next();
            var msg = new AcknowledgePrivateMessageCommand(num).ToByteArray();

            var reader = new MessageReader <MessageCode.Server>(msg);
            var code   = reader.ReadCode();

            Assert.Equal(MessageCode.Server.AcknowledgePrivateMessage, code);

            // length + code + token
            Assert.Equal(4 + 4 + 4, msg.Length);
            Assert.Equal(num, reader.ReadInteger());
        }