Esempio n. 1
0
        public void StartSysTaskProcessWithErrorTest()
        {
            SysTaskAdapter.Instance.ClearAll();

            SysTaskProcess process = PrepareSysTaskProcessData(() => PrepareErrorInvokeServiceTask());

            SysTaskProcessRuntime.StartProcess(process);

            DO.SysTask moveToTask = SysTaskAdapter.Instance.LoadByResourceID(process.Activities[0].ID).FirstOrDefault();

            Assert.IsNotNull(moveToTask);

            SysTaskCommon.ExecuteTask(moveToTask);

            SysTaskProcessRuntime.ClearCache();

            process = SysTaskProcessRuntime.GetProcessByID(process.ID);

            Assert.AreEqual(0, process.CurrentActivityIndex);
            Assert.AreEqual(SysTaskProcessStatus.Aborted, process.Status);
            Assert.AreEqual(SysTaskActivityStatus.Aborted, process.CurrentActivity.Status);
        }