Exemplo n.º 1
0
        public void ResumeTest()
        {
            int workflowId = 41;
            var instanceId = Helper.StartWorkflowAsync(workflowId);

            try
            {
                Thread.Sleep(500);
                var workflow = Helper.GetWorkflow(workflowId);
                Assert.IsFalse(workflow.IsPaused);
                Helper.SuspendWorkflow(workflowId, instanceId);
                Thread.Sleep(500);
                workflow = Helper.GetWorkflow(workflowId);
                Assert.IsTrue(workflow.IsPaused);
                Helper.ResumeWorkflow(workflowId, instanceId);
                Thread.Sleep(500);
                workflow = Helper.GetWorkflow(workflowId);
                Assert.IsFalse(workflow.IsPaused);
                Assert.IsTrue(workflow.IsRunning);
            }
            finally
            {
                Helper.StopWorkflow(workflowId, instanceId);
            }
        }
Exemplo n.º 2
0
        public void DisapprovalTest()
        {
            var workflowId = 126;
            var instanceId = Helper.StartWorkflow(workflowId);

            Thread.Sleep(500);
            Helper.DisapproveWorkflow(workflowId, instanceId);
            Stopwatch stopwatch = Stopwatch.StartNew();
            var       workflow  = Helper.GetWorkflow(workflowId);
            var       isRunning = workflow.IsRunning;

            while (isRunning)
            {
                Thread.Sleep(100);
                workflow  = Helper.GetWorkflow(workflowId);
                isRunning = workflow.IsRunning;
            }
            stopwatch.Stop();
            Assert.IsTrue(stopwatch.ElapsedMilliseconds > 3000);
        }
Exemplo n.º 3
0
        public void StopTest()
        {
            int workflowId = 41;

            try
            {
                Helper.StartWorkflowAsync(workflowId);
                Thread.Sleep(500);
                var workflow = Helper.GetWorkflow(workflowId);
                Assert.IsTrue(workflow.IsRunning);
                Helper.StopWorkflow(workflowId);
                Thread.Sleep(500);
                workflow = Helper.GetWorkflow(workflowId);
                Assert.IsFalse(workflow.IsRunning);
            }
            finally
            {
                Helper.StopWorkflow(workflowId);
            }
        }