Esempio n. 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.CompleteAsync(task, end);

            Assert.False(unitload.BeingMoved);
            Assert.Same(end, unitload.CurrentLocation);
        }
Esempio n. 2
0
        public async Task 完成任务_如果指定了实际终点_则货载被放在指定的位置上()
        {
            var      start     = NewK();
            var      end       = NewS();
            var      actualEnd = NewS();
            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.CompleteAsync(task, actualEnd);

            Assert.Same(actualEnd, unitload.CurrentLocation);
        }
Esempio n. 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.CompleteAsync(task, end);

            Assert.Equal(0, end.InboundCount);
        }