Esempio n. 1
0
        public void TestBuildIqWithStructThatContainsAnArray()
        {
            var iq = new RpcIq
            {
                Id   = "0815",
                Type = Matrix.Xmpp.IqType.Set
            };

            var call = new MethodCall {
                MethodName = "bid"
            };

            var parameters = new Parameters
            {
                new StructParameter
                {
                    { "symbol", "RHAT" },
                    { "limit", 2.25 },
                    { "some_array", new Parameters {
                          "A", "B", "C", "D"
                      } }
                }
            };

            call.SetParameters(parameters);
            iq.Rpc.MethodCall = call;
            iq.ShouldBe(Resource.Get("Xmpp.Rpc.rpc_iq3.xml"));
        }
Esempio n. 2
0
        public void TestBuildMethodcallWithIq()
        {
            var iq = new RpcIq
            {
                Id   = "0815",
                Type = Matrix.Xmpp.IqType.Set
            };

            var call = new MethodCall {
                MethodName = "bid"
            };

            var parameters = new Parameters
            {
                new StructParameter
                {
                    { "symbol", "RHAT" },
                    { "limit", 2.25 },
                    { "expires", new DateTime(2002, 07, 09, 20, 0, 0) }
                }
            };

            call.SetParameters(parameters);
            iq.Rpc.MethodCall = call;

            iq.ShouldBe(Resource.Get("Xmpp.Rpc.rpc_iq1.xml"));
        }
Esempio n. 3
0
        public void TestBuildMethodcallWithIq2()
        {
            var iq = new RpcIq
            {
                Id   = "4jLvG-34",
                To   = "[email protected]/Smack",
                From = "[email protected]/Smack",
                Type = Matrix.Xmpp.IqType.Set
            };

            var call = new MethodCall {
                MethodName = "com.collabng.net.remoteable.ViewpointRemoteable.setViewpoint"
            };

            var parameters = new Parameters
            {
                "viewpoint_BackView_collabng"
            };

            call.SetParameters(parameters);
            iq.Rpc.MethodCall = call;

            iq.ShouldBe(Resource.Get("Xmpp.Rpc.rpc_iq2.xml"));
        }