Esempio n. 1
0
        public void Should_be_active_when_activity_is_just_started_after_failure()
        {
            var eventGraph = _builder.ActivityStartedGraph(Identity.New(ActivityName, ActivityVersion).ScheduleId(), "id")
                             .Concat(_builder.ActivityFailedGraph(Identity.New(ActivityName, ActivityVersion).ScheduleId(), "id", "res", "detail"));
            var workflowHistoryEvents = new WorkflowHistoryEvents(eventGraph);

            Assert.IsTrue(workflowHistoryEvents.HasActiveEvent());
        }
Esempio n. 2
0
        public void Last_event_is_timer_event_when_timer_events_are_newer_then_activity_event()
        {
            var activityFailedEventGraph = _eventGraphBuilder.ActivityFailedGraph(_scheduleId, "workerid", "reason", "detail");
            var timerStartedEventGraph   = _eventGraphBuilder.TimerStartedGraph(_scheduleId, TimeSpan.FromSeconds(2));

            var activityItem = CreateActivityItemWith(activityFailedEventGraph.Concat(timerStartedEventGraph));

            var latestEvent = activityItem.LastEvent(true);

            Assert.That(latestEvent, Is.EqualTo(new TimerStartedEvent(timerStartedEventGraph.First(), timerStartedEventGraph)));
        }
        public void Setup()
        {
            _builder    = new EventGraphBuilder();
            _scheduleId = Guflow.Decider.Identity.New(ActivityName, ActivityVersion, PositionalName).ScheduleId();
            var failedActivityEventGraph = _builder.ActivityFailedGraph(_scheduleId, Identity, Reason, Detail);

            _activityFailedEvent = new ActivityFailedEvent(failedActivityEventGraph.First(), failedActivityEventGraph);
        }