public MovementsDetailsFactoryTests()
        {
            var movementRepository = A.Fake<IMovementRepository>();
            var shipmentRepository = A.Fake<IShipmentInfoRepository>();

            // Setup notification with 1000Kg intended quantity and 950Kg received

            movement = new TestableMovement
            {
                Id = new Guid("B3A80B02-52BF-4051-9BE8-7AA9F7758E0E"),
                NotificationId = notificationId,
                Receipt = new TestableMovementReceipt
                {
                    QuantityReceived = new ShipmentQuantity(950, ShipmentQuantityUnits.Kilograms)
                }
            };

            A.CallTo(() => movementRepository.GetMovementsByStatus(notificationId, MovementStatus.Received))
                .Returns(new[] { movement });

            var shipment = new TestableShipmentInfo
            {
                NotificationId = notificationId,
                Quantity = 1000,
                Units = ShipmentQuantityUnits.Kilograms
            };

            A.CallTo(() => shipmentRepository.GetByNotificationId(notificationId))
                .Returns(shipment);

            var movementQuantity = new NotificationMovementsQuantity(movementRepository, shipmentRepository);
            factory = new MovementDetailsFactory(movementQuantity);
        }
        public MovementsDetailsFactoryTests()
        {
            var movementRepository = A.Fake <IMovementRepository>();
            var shipmentRepository = A.Fake <IShipmentInfoRepository>();

            // Setup notification with 1000Kg intended quantity and 950Kg received

            movement = new TestableMovement
            {
                Id             = new Guid("B3A80B02-52BF-4051-9BE8-7AA9F7758E0E"),
                NotificationId = notificationId,
                Receipt        = new TestableMovementReceipt
                {
                    QuantityReceived = new ShipmentQuantity(950, ShipmentQuantityUnits.Kilograms)
                }
            };

            A.CallTo(() => movementRepository.GetMovementsByStatus(notificationId, MovementStatus.Received))
            .Returns(new[] { movement });

            var shipment = new TestableShipmentInfo
            {
                NotificationId = notificationId,
                Quantity       = 1000,
                Units          = ShipmentQuantityUnits.Kilograms
            };

            A.CallTo(() => shipmentRepository.GetByNotificationId(notificationId))
            .Returns(shipment);

            var movementQuantity = new NotificationMovementsQuantity(movementRepository, shipmentRepository);

            factory = new MovementDetailsFactory(movementQuantity);
        }
Пример #3
0
 public CreateMovementsHandler(MovementFactory movementFactory,
                               MovementDetailsFactory movementDetailsFactory,
                               INotificationApplicationRepository notificationRepository,
                               IwsContext context,
                               IMovementAuditRepository movementAuditRepository,
                               IUserContext userContext)
 {
     this.movementFactory        = movementFactory;
     this.movementDetailsFactory = movementDetailsFactory;
     this.context = context;
     this.notificationRepository  = notificationRepository;
     this.movementAuditRepository = movementAuditRepository;
     this.userContext             = userContext;
 }
Пример #4
0
 public CreatePrenotificationHandler(INotificationApplicationRepository notificationRepository,
                                     IDraftMovementRepository draftMovementRepository,
                                     IwsContext context,
                                     MovementFactory movementFactory,
                                     MovementDetailsFactory movementDetailsFactory,
                                     IFileRepository fileRepository,
                                     IMovementAuditRepository movementAuditRepository,
                                     IUserContext userContext)
 {
     this.notificationRepository  = notificationRepository;
     this.draftMovementRepository = draftMovementRepository;
     this.context                 = context;
     this.movementFactory         = movementFactory;
     this.movementDetailsFactory  = movementDetailsFactory;
     this.fileRepository          = fileRepository;
     this.movementAuditRepository = movementAuditRepository;
     this.userContext             = userContext;
 }