예제 #1
0
 public void TestPacketHeaderMinRequest()
 {
     var p = new RpcHeader(0);
     Assert.AreEqual(0, p.Request);
     Assert.AreEqual(0x8000000000000000, p.Response(0));
     Assert.AreEqual(0x80000000ffffffff, p.Response(uint.MaxValue));
     Assert.AreEqual(true, p.IsRequest);
     Assert.AreEqual(0, p.MethodId);
     Assert.AreEqual(0, p.PacketId);
     Assert.AreEqual(0, p.Length);
 }
예제 #2
0
 public void TestPacketHeaderMaxResponse()
 {
     var p = new RpcHeader(UInt64.MaxValue);
     Assert.AreEqual(Int64.MaxValue, p.Request);
     Assert.AreEqual(0xffffffff00000000, p.Response(0));
     Assert.AreEqual(0xffffffffffffffff, p.Response(uint.MaxValue));
     Assert.AreEqual(false, p.IsRequest);
     Assert.AreEqual(Int16.MaxValue, p.MethodId);
     Assert.AreEqual(UInt16.MaxValue, p.PacketId);
     Assert.AreEqual(UInt32.MaxValue, p.Length);
 }
예제 #3
0
        public void TestPacketHeaderMinRequest()
        {
            var p = new RpcHeader(0);

            Assert.AreEqual(0, p.Request);
            Assert.AreEqual(0x8000000000000000, p.Response(0));
            Assert.AreEqual(0x80000000ffffffff, p.Response(uint.MaxValue));
            Assert.AreEqual(true, p.IsRequest);
            Assert.AreEqual(0, p.MethodId);
            Assert.AreEqual(0, p.PacketId);
            Assert.AreEqual(0, p.Length);
        }
예제 #4
0
        public void TestPacketHeaderMaxResponse()
        {
            var p = new RpcHeader(UInt64.MaxValue);

            Assert.AreEqual(Int64.MaxValue, p.Request);
            Assert.AreEqual(0xffffffff00000000, p.Response(0));
            Assert.AreEqual(0xffffffffffffffff, p.Response(uint.MaxValue));
            Assert.AreEqual(false, p.IsRequest);
            Assert.AreEqual(Int16.MaxValue, p.MethodId);
            Assert.AreEqual(UInt16.MaxValue, p.PacketId);
            Assert.AreEqual(UInt32.MaxValue, p.Length);
        }