Beispiel #1
0
 //流程器初始化
 private void taskInitialize()
 {
     homeTask = new ActionTask();
     itemHome = new ActionItem("Home", false, null, flowHome);
     homeTask.Add(itemHome);
     homeTask.Run(TaskRunType.Cycle, 15);
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }