//流程器初始化 private void taskInitialize() { homeTask = new ActionTask(); itemHome = new ActionItem("Home", false, null, flowHome); homeTask.Add(itemHome); homeTask.Run(TaskRunType.Cycle, 15); }
public void ShouldExecuteDelegate() { //arrange var actionMock = new Mock <Action>(); var task = new ActionTask(actionMock.Object); //action task.Run(); //assert actionMock.Verify(a => a(), Times.Once); }
public void ShouldInvokeTaskRunning() { //arrange var task = new ActionTask(() => { }); var actionMock = new Mock <Action <ITask> >(); task.Running += actionMock.Object; //action task.Run(); //assert actionMock.Verify(c => c(It.IsAny <ITask>()), Times.Once); }