public void Setup()
 {
     _builder  = new HistoryEventsBuilder();
     _workflow = new Mock <IWorkflow>();
     _expectedWorkflowDecision  = new Mock <WorkflowDecision>(false, false).Object;
     _interpretedWorkflowAction = WorkflowAction.Custom(_expectedWorkflowDecision);
 }
        public void Should_accumulate_the_interpreted_actions()
        {
            var timerFailedDecision = new Mock <WorkflowDecision>(false, false);
            var timerFailedAction   = WorkflowAction.Custom(timerFailedDecision.Object);

            _workflow.Setup(w => w.OnTimerFired(It.IsAny <TimerFiredEvent>())).Returns(_interpretedWorkflowAction);
            _workflow.Setup(w => w.OnTimerStartFailure(It.IsAny <TimerStartFailedEvent>())).Returns(timerFailedAction);
            var timerFiredAndFailedEvents = CreateTimerFireAndFailedEventGraph();

            var workflowDecisions = timerFiredAndFailedEvents.InterpretNewEventsFor(_workflow.Object);

            Assert.That(workflowDecisions, Is.EquivalentTo(new[] { _expectedWorkflowDecision, timerFailedDecision.Object }));
        }
Example #3
0
 internal override WorkflowAction Interpret(IWorkflow workflow)
 {
     return(WorkflowAction.Custom(_decision));
 }