コード例 #1
0
        private void EncodeDecode(Message orig)
        {
            orig.Encode(buffer, offset);
            Message dec = PeerMessage.DecodeMessage(buffer, offset, orig.ByteLength, testRig.Manager);
            Assert.True(orig.Equals(dec), string.Format("orig: {0}, new: {1}", orig, dec));

            Assert.True(Toolbox.ByteMatch(orig.Encode(),
                PeerMessage.DecodeMessage(orig.Encode(), 0, orig.ByteLength, testRig.Manager).Encode()));
        }