示例#1
0
        public void TestExecuteWithOutPassword()
        {
            IDemo demo = XmlRpcProxyFactory.Create <IDemo>();

            demo.WebAddress = new Uri("http://localhost:8084/TestRPC/GatewayOffice");
            String res = demo.Add(4, 3.2, "", DateTime.Now, true);

            Assert.IsNotNull(res);
        }
示例#2
0
        public void TestExecute()
        {
            IDemo demo = XmlRpcProxyFactory.Create <IDemo>();

            demo.WebAddress  = new Uri("http://localhost:8084/TestRPC/GatewayOffice");
            demo.Credentials = new System.Net.NetworkCredential("victor", "Lorenzana");
            String res = demo.Add(4, 3.2, "", DateTime.Now, true);

            Assert.IsFalse(String.IsNullOrEmpty(res));
        }
示例#3
0
        public void TestExecuteWithInvalidMethod()
        {
            IDemo demo = XmlRpcProxyFactory.Create <IDemo>();

            demo.WebAddress  = new Uri("http://localhost:8084/TestRPC/GatewayOffice");
            demo.Credentials = new System.Net.NetworkCredential("victor", "Lorenzana");
            String res = demo.Add(4, 3.2, "", DateTime.Now, 1);

            Assert.IsNotNull(res);
        }
示例#4
0
        public Task StartAsync(CancellationToken cancellationToken)
        {
            //jobClient.Enqueue(() => Console.WriteLine(DateTime.Now.ToString()));
            //backgroundJobQueue.EnqueueJobs();

            //mediator.Publish(new Com.StarZ.MediatR.DemoNotification() { Message = "hahahah" });

            //var r = mediator.Send(new Com.StarZ.MediatR.DemoRequest() { Message = "tttttt" });
            //Console.WriteLine(r.Result.Message);
            RecurringJob.AddOrUpdate("Demo", () => demo.Add(), "*/5 * * * * *");
            RecurringJob.AddOrUpdate(typeof(IDemo).FullName, () => demo.DoWork(), "*/30 * * * * *");
            return(Task.CompletedTask);
        }
示例#5
0
        public void TestExecuteWithBadPath()
        {
            try
            {
                IDemo demo = XmlRpcProxyFactory.Create <IDemo>();

                demo.WebAddress  = new Uri("http://localhost:8084/TestRPC/GatewayOffice2");
                demo.Credentials = new System.Net.NetworkCredential("victor", "Lorenzana");
                String res = demo.Add(4, 3.2, "", DateTime.Now, true);
                Assert.IsNotNull(res);
            }
            catch (UriFormatException e)
            {
                Assert.Fail(e.Message);
            }
        }