public void VertexTypeToProcess() { var collection = ScheduleActionStorage.CreateInstanceWithoutTimeline(); var processor = new ActionVertexProcessor(collection); Assert.AreEqual(typeof(ExecutingActionVertex), processor.VertexTypeToProcess); }
public void ProcessWithIncorrectVertexType() { var collection = ScheduleActionStorage.CreateInstanceWithoutTimeline(); var processor = new ActionVertexProcessor(collection); using (var info = new ScheduleExecutionInfo()) { var state = processor.Process(new StartVertex(1), info); Assert.AreEqual(ScheduleExecutionState.IncorrectProcessorForVertex, state); } }
public void Process() { var action = new Mock <IScheduleAction>(); { action.Setup(a => a.Execute(It.IsAny <CancellationToken>())) .Verifiable(); } var collection = ScheduleActionStorage.CreateInstanceWithoutTimeline(); var info = collection.Add( action.Object, "a", "b"); var processor = new ActionVertexProcessor(collection); using (var executionInfo = new ScheduleExecutionInfo()) { var state = processor.Process(new ExecutingActionVertex(1, info.Id), executionInfo); Assert.AreEqual(ScheduleExecutionState.Executing, state); action.Verify(a => a.Execute(It.IsAny <CancellationToken>()), Times.Once()); } }