Exemplo n.º 1
0
        public void TestBuildMethodResponseQuery()
        {
            var rpc  = new Matrix.Xmpp.Rpc.Rpc();
            var resp = new MethodResponse();

            var pars = new Parameters {
                "Colorado"
            };

            resp.SetParameters(pars);

            rpc.MethodResponse = resp;
            rpc.ShouldBe(Resource.Get("Xmpp.Rpc.rpc_query_response2.xml"));
        }
Exemplo n.º 2
0
        public void TestBuildFaultResponse()
        {
            var resp = new MethodResponse();

            Assert.Equal(resp.IsError, false);
            var pars = new Parameters {
                new XmlRpcException("Unknown stock symbol ABCD")
                {
                    Code = 23
                }
            };

            resp.SetParameters(pars);

            Assert.Equal(resp.IsError, true);
            resp.ShouldBe(Resource.Get("Xmpp.Rpc.rpc_query_response3.xml"));
        }