public async Task WasteReceivedDateBeforeActualShipmentDate_Throws()
        {
            movement = new ImportMovement(notificationId, 52, FutureDate);

            movementReceipt = new ImportMovementReceipt(movementId, new ShipmentQuantity(10, ShipmentQuantityUnits.Kilograms), FutureDate);

            A.CallTo(() => movementRepository.Get(movementId)).Returns(movement);

            A.CallTo(() => receiptRepository.GetByMovementIdOrDefault(movementId)).Returns(movementReceipt);

            await Assert.ThrowsAsync <InvalidOperationException>(() => completeFactory.Complete(movementId, PastDate));
        }
        public async Task WasteReceivedDateCanBeToday()
        {
            movement = new ImportMovement(notificationId, 52, PastDate);

            movementReceipt = new ImportMovementReceipt(movementId, new ShipmentQuantity(10, ShipmentQuantityUnits.Kilograms), PastDate);

            A.CallTo(() => movementRepository.Get(movementId)).Returns(movement);
            A.CallTo(() => receiptRepository.GetByMovementIdOrDefault(movementId)).Returns(movementReceipt);

            var result = await completeFactory.Complete(movementId, Today);

            Assert.Equal(Today, result.Date);
        }
Beispiel #3
0
 public void Add(ImportMovementReceipt receipt)
 {
     context.ImportMovementReceipts.Add(receipt);
 }