Пример #1
0
        public void SQP_SerializeQueryRequest_NoError()
        {
            var id    = (uint)1337;
            var chunk = (byte)31;

            var snd = new QueryRequest();

            snd.Header.ChallangeId = id;
            snd.RequestedChunks    = chunk;

            snd.ToStream(ref writer);

            var rcv = new QueryRequest();

            rcv.FromStream(ref reader);

            Assert.AreEqual((byte)SQPMessageType.QueryRequest, rcv.Header.Type);
            Assert.AreEqual(id, (uint)rcv.Header.ChallangeId);
            Assert.AreEqual(chunk, rcv.RequestedChunks);
        }