public void By_default_returns_fail_workflow_decision() { var workflow = new WorkflowWithTimer(); var decisions = _timerStartFailedEvent.Interpret(workflow).GetDecisions(); Assert.That(decisions, Is.EqualTo(new [] { new FailWorkflowDecision("TIMER_START_FAILED", _timerFailureCause) })); }
public void By_default_return_cancel_workflow_decision() { var workflow = new WorkflowWithTimer(); var decisions = _timerCancelledEvent.Interpret(workflow).GetDecisions(); Assert.That(decisions, Is.EqualTo(new [] { new CancelWorkflowDecision("TIMER_CANCELLED") })); }
public void By_default_return_continue_workflow_action() { var workflow = new WorkflowWithTimer(); var workflowAction = _timerFiredEvent.Interpret(workflow); Assert.That(workflowAction, Is.EqualTo(WorkflowAction.ContinueWorkflow(TimerItem.New(Identity.Timer(_timerName), null)))); }
public void By_default_returns_fail_workflow_decision() { var workflow = new WorkflowWithTimer(); _builder.AddNewEvents(_graphBuilder.TimerStartFailedGraph(_identity.ScheduleId(), TimerFailureCause).ToArray()); var decisions = workflow.Decisions(_builder.Result()); Assert.That(decisions, Is.EqualTo(new [] { new FailWorkflowDecision("TIMER_START_FAILED", TimerFailureCause) })); }
public void By_default_schedule_children() { _builder.AddNewEvents(_graphBuilder.TimerFiredGraph(_identity.ScheduleId(), TimeSpan.Zero).ToArray()); var workflow = new WorkflowWithTimer(); var decisions = workflow.Decisions(_builder.Result()); Assert.That(decisions, Is.EqualTo(new [] { new ScheduleLambdaDecision(Identity.Lambda(LambdaName).ScheduleId(), "input") })); }
public void Should_return_schedule_workflow_action_if_timer_is_fired_to_reschedule_a_timer_item() { var workflow = new WorkflowWithTimer(); var rescheduleTimer = CreateRescheduleTimerFiredEvent(Identity.Timer(_timerName), _fireAfter); var workflowAction = rescheduleTimer.Interpret(workflow); Assert.That(workflowAction, Is.EqualTo(WorkflowAction.Schedule(TimerItem.New(Identity.Timer(_timerName), null)))); }
public void Schedule_children_when_reset_timer_is_fired() { const string runId = "runid"; _builder.AddWorkflowRunId(runId); _builder.AddNewEvents(_graphBuilder.TimerFiredGraph(_identity.ScheduleId(runId + "Reset"), TimeSpan.Zero).ToArray()); var workflow = new WorkflowWithTimer(); var decisions = workflow.Decisions(_builder.Result()); Assert.That(decisions, Is.EqualTo(new[] { new ScheduleLambdaDecision(Identity.Lambda(LambdaName).ScheduleId(), "input") })); }
public void Returns_schedule_timer_decision_if_timer_is_fired_to_reschedule_a_timer_item_using_old_data_object() { var workflow = new WorkflowWithTimer(); _builder.AddNewEvents(_graphBuilder.TimerFiredGraph(_identity.ScheduleId(), _fireAfter, true).ToArray()); var decisions = workflow.Decisions(_builder.Result()).ToArray(); var scheduleId = Identity.Timer(TimerName).ScheduleId(); Assert.That(decisions.Length, Is.EqualTo(1)); decisions[0].AssertWorkflowItemTimer(scheduleId, TimeSpan.Zero); }