Ejemplo n.º 1
0
 public void Test_Forward()
 {
     _rpcImpl.rpcForward(true, 0);
     Assert.IsTrue(_rpcNetwork.isForwarded);
     Assert.AreEqual(RpcController.makeRpcName("TestRpc", "rpcForward", 2),
                     _rpcNetwork.rpcId.rpcName);
     Assert.AreEqual(2, _rpcNetwork.paramCount);
 }
Ejemplo n.º 2
0
        public void Test_Receive()
        {
            StreamBuffer buffer       = new StreamBuffer(100);
            InputStream  inputStream  = new InputStream(buffer);
            OutputStream outputStream = new OutputStream(buffer);

            outputStream.write((int)1);
            outputStream.write((short)2);
            outputStream.write("abcd");

            RpcId rpcId = new RpcId(RpcController.makeRpcName("TestRpc", "rpcReceive", 3));

            _rpcNetwork.handleRpc(rpcId.value, inputStream);
            Assert.AreEqual(2, _rpcImpl.receiveRpcCount);
        }