Ejemplo n.º 1
0
        public void VertexTypeToProcess()
        {
            var timeline  = new Mock <ITimeline>();
            var processor = new MarkHistoryVertexProcessor(timeline.Object, m => { });

            Assert.AreEqual(typeof(MarkHistoryVertex), processor.VertexTypeToProcess);
        }
 public void ProcessWithIncorrectVertexType()
 {
     var timeline = new Mock<ITimeline>();
     var processor = new MarkHistoryVertexProcessor(timeline.Object, m => { });
     using (var info = new ScheduleExecutionInfo())
     {
         var state = processor.Process(new StartVertex(1), info);
         Assert.AreEqual(ScheduleExecutionState.IncorrectProcessorForVertex, state);
     }
 }
Ejemplo n.º 3
0
        public void ProcessWithIncorrectVertexType()
        {
            var timeline  = new Mock <ITimeline>();
            var processor = new MarkHistoryVertexProcessor(timeline.Object, m => { });

            using (var info = new ScheduleExecutionInfo())
            {
                var state = processor.Process(new StartVertex(1), info);
                Assert.AreEqual(ScheduleExecutionState.IncorrectProcessorForVertex, state);
            }
        }
        public void ProcessWithCancellation()
        {
            var timeline = new Mock<ITimeline>();
            using (var info = new ScheduleExecutionInfo())
            {
                info.CancelScheduleExecution();

                var processor = new MarkHistoryVertexProcessor(timeline.Object, m => { });
                var state = processor.Process(new MarkHistoryVertex(1), info);
                Assert.AreEqual(ScheduleExecutionState.Canceled, state);
            }
        }
Ejemplo n.º 5
0
        public void ProcessWithCancellation()
        {
            var timeline = new Mock <ITimeline>();

            using (var info = new ScheduleExecutionInfo())
            {
                info.CancelScheduleExecution();

                var processor = new MarkHistoryVertexProcessor(timeline.Object, m => { });
                var state     = processor.Process(new MarkHistoryVertex(1), info);
                Assert.AreEqual(ScheduleExecutionState.Canceled, state);
            }
        }
        public void Process()
        {
            var marker = new TimeMarker(10);
            var timeline = new Mock<ITimeline>();
            {
                timeline.Setup(t => t.Mark())
                    .Returns(marker);
            }

            TimeMarker storedMarker = null;
            var processor = new MarkHistoryVertexProcessor(timeline.Object, m => storedMarker = m);
            using (var info = new ScheduleExecutionInfo())
            {
                var state = processor.Process(new MarkHistoryVertex(1), info);
                Assert.AreEqual(ScheduleExecutionState.Executing, state);
                Assert.AreEqual(marker, storedMarker);
            }
        }
Ejemplo n.º 7
0
        public void Process()
        {
            var marker   = new TimeMarker(10);
            var timeline = new Mock <ITimeline>();
            {
                timeline.Setup(t => t.Mark())
                .Returns(marker);
            }

            TimeMarker storedMarker = null;
            var        processor    = new MarkHistoryVertexProcessor(timeline.Object, m => storedMarker = m);

            using (var info = new ScheduleExecutionInfo())
            {
                var state = processor.Process(new MarkHistoryVertex(1), info);
                Assert.AreEqual(ScheduleExecutionState.Executing, state);
                Assert.AreEqual(marker, storedMarker);
            }
        }
 public void VertexTypeToProcess()
 {
     var timeline = new Mock<ITimeline>();
     var processor = new MarkHistoryVertexProcessor(timeline.Object, m => { });
     Assert.AreEqual(typeof(MarkHistoryVertex), processor.VertexTypeToProcess);
 }