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