Пример #1
0
        public void pick(TransferPosition position)
        {
            TransferPosition pickedPosition = positions.Find(i => i.Equals(position));

            if (pickedPosition == null)
            {
                throw new TransferPositionNotFoundException();
            }
            pickedPosition.markPick();
        }
Пример #2
0
 public override bool Equals(Object obj)
 {
     if (obj is TransferPosition)
     {
         TransferPosition position = (TransferPosition)obj;
         return(position.item.Equals(item) &&
                position.sourcePlace.Equals(sourcePlace) &&
                status.Equals(status));
     }
     return(false);
 }
Пример #3
0
        public void ExecuteTransferTest()
        {
            var transfer  = transferFactory.build();
            var employee  = employeeFactory.build();
            var item1     = itemFactory.build();
            var quantity1 = 1.0;
            var place1    = placeFactory.build();
            var item2     = itemFactory.build();
            var quantity2 = 1.0;
            var place2    = placeFactory.build();

            var item1ToPick = new TransferPosition(item1, place1, quantity1);
            var item2ToPick = new TransferPosition(item2, place2, quantity2);
        }
Пример #4
0
        public void AddPickPositionToTransferTest()
        {
            var transfer = transferFactory.build();
            var item     = itemFactory.build();
            var quantity = 1.0;
            var place    = placeFactory.build();

            var itemToPick = new TransferPosition(item, place, quantity);

            transfer.addPositionToPick(itemToPick);

            Assert.IsTrue(transfer.hasItemsToPick());

            var nextItemToPick = transfer.getNextPositionToPick();

            Assert.AreEqual(nextItemToPick, itemToPick);
        }
Пример #5
0
        public void ReleaseTransferTest()
        {
            var transfer   = transferFactory.build();
            var employee   = employeeFactory.build();
            var item       = itemFactory.build();
            var quantity   = 1.0;
            var place      = placeFactory.build();
            var itemToPick = new TransferPosition(item, place, quantity);

            Assert.Throws <TransferNotAssignedException> (delegate { transfer.release(); });

            transfer.assignTo(employee);

            Assert.DoesNotThrow(delegate { transfer.release(); });

            transfer.assignTo(employee);

            transfer.addPositionToPick(itemToPick);
            transfer.pick(itemToPick);

            Assert.Throws <TransferIsPerfomingException> (delegate { transfer.release(); });
        }
Пример #6
0
 public void addPositionToPick(TransferPosition position)
 {
     positions.Add(new TransferPosition(position.item, position.sourcePlace, position.quantity));
 }