Example #1
0
        public async Task 取消任务_检查货载属性()
        {
            var      start    = NewK();
            var      end      = NewK();
            Unitload unitload = new Unitload();

            unitload.Enter(start);
            TransportTask task       = new TransportTask();
            TaskHelper    taskHelper = new TaskHelper(For <ISession>(),
                                                      For <IAppSeqService>(),
                                                      new UnitloadSnapshopHelper(new DefaultUnitloadSnapshotFactory(), Log.Logger),
                                                      Log.Logger);
            await taskHelper.BuildAsync(task, "A", start, end, unitload);

            await taskHelper.CancelAsync(task);

            Assert.False(unitload.BeingMoved);
        }
Example #2
0
        public async Task 取消任务_如果起点不是N位置_则货载保持在原位置上()
        {
            var      start    = NewK();
            var      end      = NewK();
            Unitload unitload = new Unitload();

            unitload.Enter(start);
            TransportTask task       = new TransportTask();
            TaskHelper    taskHelper = new TaskHelper(For <ISession>(),
                                                      For <IAppSeqService>(),
                                                      new UnitloadSnapshopHelper(new DefaultUnitloadSnapshotFactory(), Log.Logger),
                                                      Log.Logger);
            await taskHelper.BuildAsync(task, "A", start, end, unitload);

            await taskHelper.CancelAsync(task);

            Assert.Same(start, unitload.CurrentLocation);
        }
Example #3
0
        public async Task 取消任务_起点的出站数会减少()
        {
            var      start    = NewK();
            var      end      = NewK();
            Unitload unitload = new Unitload();

            unitload.Enter(start);
            TransportTask task       = new TransportTask();
            TaskHelper    taskHelper = new TaskHelper(For <ISession>(),
                                                      For <IAppSeqService>(),
                                                      new UnitloadSnapshopHelper(new DefaultUnitloadSnapshotFactory(), Log.Logger),
                                                      Log.Logger);
            await taskHelper.BuildAsync(task, "A", start, end, unitload);

            await taskHelper.CancelAsync(task);

            Assert.Equal(0, start.OutboundCount);
        }