Esempio n. 1
0
        public void All_lambdas()
        {
            var workflow = new WorkflowWithLambda();

            Assert.That(workflow.AllLambdaItems.Count(), Is.EqualTo(2));
            Assert.That(workflow.LambdaItem("Lambda2").Name, Is.EqualTo("Lambda2"));
        }
        public void Fail_workflow_for_lambda_reschedule_timer()
        {
            var workflow = new WorkflowWithLambda();
            var timerCancellationFailedEvent = CreateTimerCancellationFailedEvent(Identity.Lambda(LambdaName), Cause);
            var decisions = timerCancellationFailedEvent.Interpret(workflow).Decisions(Mock.Of <IWorkflow>());

            Assert.That(decisions, Is.EqualTo(new[] { new FailWorkflowDecision("RESCHEDULE_TIMER_CANCELLATION_FAILED", Cause) }));
        }
        public void Fail_workflow_for_lambda_reshedule_timer()
        {
            var workflow = new WorkflowWithLambda();
            var rescheduleTimerStartFailed = CreateTimerStartFailedEvent(Identity.Lambda(LambdaName), TimerFailureCause);

            var decisions = rescheduleTimerStartFailed.Interpret(workflow).Decisions(Mock.Of <IWorkflow>());

            Assert.That(decisions, Is.EqualTo(new[] { new FailWorkflowDecision("RESCHEDULE_TIMER_START_FAILED", TimerFailureCause) }));
        }
Esempio n. 4
0
        public void Schedule_children()
        {
            const string runId = "runid";

            _builder.AddWorkflowRunId(runId);
            _builder.AddNewEvents(_eventGraph.ToArray());

            var decisions = new WorkflowWithLambda().Decisions(_builder.Result()).ToArray();

            var scheduleId = Identity.Timer("timer_name").ScheduleId();

            Assert.That(decisions.Length, Is.EqualTo(1));
            decisions[0].AssertWorkflowItemTimer(scheduleId, TimeSpan.Zero);
        }