コード例 #1
0
        public void Can_return_custom_action()
        {
            _builder.AddNewEvents(_eventGraph);
            var w         = new TestWorkflow("result");
            var decisions = w.Decisions(_builder.Result());

            Assert.That(decisions, Is.EqualTo(new [] { new CompleteWorkflowDecision("result") }));
        }
コード例 #2
0
        public void Return_schedule_decisions_for_startup_items()
        {
            _eventsBuilder.AddNewEvents(_eventGraphBuilder.WorkflowStartedEvent());
            var workflow = new TestWorkflow();

            var workflowStartedDecisions = workflow.Decisions(_eventsBuilder.Result());

            Assert.That(workflowStartedDecisions, Is.EquivalentTo(new[] { new ScheduleActivityDecision(Identity.New("Download", "1.0").ScheduleId()) }));
        }
コード例 #3
0
        public void Get_timer_by_its_event()
        {
            var identity   = Identity.Timer("Timer1");
            var eventGraph = _graphBuilder.TimerFiredGraph(identity.ScheduleId(), TimeSpan.FromSeconds(2));

            _builder.AddNewEvents(eventGraph.ToArray());

            var workflow = new TestWorkflow();

            workflow.Decisions(_builder.Result());

            var timer = workflow.TimerItem;

            Assert.That(workflow.TimerItem.Name, Is.EqualTo("Timer1"));
        }