コード例 #1
0
        public MovementQuantityTests()
        {
            movement = new TestableMovement
            {
                Status  = MovementStatus.Received,
                Receipt = new TestableMovementReceipt
                {
                    Date             = new DateTime(2015, 9, 1),
                    Decision         = Core.MovementReceipt.Decision.Accepted,
                    QuantityReceived = new ShipmentQuantity(5, ShipmentQuantityUnits.Kilograms)
                }
            };

            shipmentInfo = new TestableShipmentInfo
            {
                Quantity = 20,
                Units    = ShipmentQuantityUnits.Kilograms
            };

            movementRepository = A.Fake <IMovementRepository>();
            shipmentRepository = A.Fake <IShipmentInfoRepository>();
            movementPartialRejectionRepository = A.Fake <IMovementPartialRejectionRepository>();

            movementQuantity = new NotificationMovementsQuantity(movementRepository, shipmentRepository, movementPartialRejectionRepository);
        }
コード例 #2
0
        public NumberOfMovementsTests()
        {
            shipmentRepository = A.Fake <IShipmentInfoRepository>();
            movementRepository = A.Fake <IMovementRepository>();

            numberOfMovements = new NumberOfMovements(movementRepository, shipmentRepository);
        }
コード例 #3
0
 public NotificationMovementsQuantity(IMovementRepository movementRepository, IShipmentInfoRepository shipmentRepository,
                                      IMovementPartialRejectionRepository movementPartialRejectionRepository)
 {
     this.movementRepository = movementRepository;
     this.shipmentRepository = shipmentRepository;
     this.movementPartialRejectionRepository = movementPartialRejectionRepository;
 }
コード例 #4
0
        public MovementFactoryTests()
        {
            SystemTime.Freeze(Today);

            shipmentRepository                 = A.Fake <IShipmentInfoRepository>();
            movementRepository                 = A.Fake <IMovementRepository>();
            assessmentRepository               = A.Fake <INotificationAssessmentRepository>();
            financialGuaranteeRepository       = A.Fake <IFinancialGuaranteeRepository>();
            consentRepository                  = A.Fake <INotificationConsentRepository>();
            workingDayCalculator               = A.Fake <IWorkingDayCalculator>();
            notificationApplicationRepository  = A.Fake <INotificationApplicationRepository>();
            financialGuaranteeRepository       = A.Fake <IFinancialGuaranteeRepository>();
            movementPartialRejectionRepository = A.Fake <IMovementPartialRejectionRepository>();

            dateValidator = A.Fake <IMovementDateValidator>();

            var movementNumberGenerator = new MovementNumberGenerator(new NextAvailableMovementNumberGenerator(movementRepository),
                                                                      movementRepository,
                                                                      shipmentRepository);
            var numberOfMovements   = new NumberOfMovements(movementRepository, shipmentRepository);
            var movementsQuatity    = new NotificationMovementsQuantity(movementRepository, shipmentRepository, movementPartialRejectionRepository);
            var numberOfActiveLoads = new NumberOfActiveLoads(movementRepository, financialGuaranteeRepository);
            var consentPeriod       = new ConsentPeriod(consentRepository, workingDayCalculator, notificationApplicationRepository);

            factory = new MovementFactory(numberOfMovements,
                                          movementsQuatity,
                                          assessmentRepository,
                                          movementNumberGenerator,
                                          numberOfActiveLoads,
                                          consentPeriod,
                                          dateValidator,
                                          financialGuaranteeRepository,
                                          A.Fake <IUserContext>());
        }
コード例 #5
0
        public MovementFactoryTests()
        {
            SystemTime.Freeze(Today);

            shipmentRepository = A.Fake<IShipmentInfoRepository>();
            movementRepository = A.Fake<IMovementRepository>();
            assessmentRepository = A.Fake<INotificationAssessmentRepository>();
            financialGuaranteeRepository = A.Fake<IFinancialGuaranteeRepository>();
            consentRepository = A.Fake<INotificationConsentRepository>();
            workingDayCalculator = A.Fake<IWorkingDayCalculator>();
            notificationApplicationRepository = A.Fake<INotificationApplicationRepository>();
            financialGuaranteeRepository = A.Fake<IFinancialGuaranteeRepository>();

            dateValidator = A.Fake<IMovementDateValidator>();

            var movementNumberGenerator = new MovementNumberGenerator(new NextAvailableMovementNumberGenerator(movementRepository), 
                movementRepository, 
                shipmentRepository);
            var numberOfMovements = new NumberOfMovements(movementRepository, shipmentRepository);
            var movementsQuatity = new NotificationMovementsQuantity(movementRepository, shipmentRepository);
            var numberOfActiveLoads = new NumberOfActiveLoads(movementRepository, financialGuaranteeRepository);
            var consentPeriod = new ConsentPeriod(consentRepository, workingDayCalculator, notificationApplicationRepository);

            factory = new MovementFactory(numberOfMovements,
                movementsQuatity,
                assessmentRepository,
                movementNumberGenerator,
                numberOfActiveLoads,
                consentPeriod,
                dateValidator,
                financialGuaranteeRepository,
                A.Fake<IUserContext>());
        }
コード例 #6
0
 public GeneralBlockFactory(INotificationApplicationRepository notificationApplicationRepository,
     IShipmentInfoRepository shipmentInfoRepository, IFacilityRepository facilityRepository)
 {
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.shipmentInfoRepository = shipmentInfoRepository;
     this.facilityRepository = facilityRepository;
 }
コード例 #7
0
ファイル: GeneralBlockFactory.cs プロジェクト: DEFRA/prsd-iws
 public GeneralBlockFactory(INotificationApplicationRepository notificationApplicationRepository,
                            IShipmentInfoRepository shipmentInfoRepository, IFacilityRepository facilityRepository)
 {
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.shipmentInfoRepository            = shipmentInfoRepository;
     this.facilityRepository = facilityRepository;
 }
コード例 #8
0
        public MovementNumberGeneratorTests()
        {
            SystemTime.Freeze(new DateTime(2015, 1, 1));

            movementRepository = A.Fake<IMovementRepository>();
            shipmentRepository = A.Fake<IShipmentInfoRepository>();
            generator = new MovementNumberGenerator(new NextAvailableMovementNumberGenerator(movementRepository), movementRepository, shipmentRepository);
        }
コード例 #9
0
        public MovementNumberGeneratorTests()
        {
            SystemTime.Freeze(new DateTime(2015, 1, 1));

            movementRepository = A.Fake <IMovementRepository>();
            shipmentRepository = A.Fake <IShipmentInfoRepository>();
            generator          = new MovementNumberGenerator(new NextAvailableMovementNumberGenerator(movementRepository), movementRepository, shipmentRepository);
        }
コード例 #10
0
 public MovementNumberGenerator(INextAvailableMovementNumberGenerator nextAvailableMovementNumberGenerator,
     IMovementRepository movementRepository, 
     IShipmentInfoRepository shipmentRepository)
 {
     this.nextAvailableMovementNumberGenerator = nextAvailableMovementNumberGenerator;
     this.movementRepository = movementRepository;
     this.shipmentRepository = shipmentRepository;
 }
コード例 #11
0
 public MovementNumberGenerator(INextAvailableMovementNumberGenerator nextAvailableMovementNumberGenerator,
                                IMovementRepository movementRepository,
                                IShipmentInfoRepository shipmentRepository)
 {
     this.nextAvailableMovementNumberGenerator = nextAvailableMovementNumberGenerator;
     this.movementRepository = movementRepository;
     this.shipmentRepository = shipmentRepository;
 }
コード例 #12
0
 public GetRemainingShipmentsHandler(IMovementRepository movementRepository,
                                     IShipmentInfoRepository shipmentRepository,
                                     IFinancialGuaranteeRepository financialGuaranteeRepository)
 {
     this.movementRepository           = movementRepository;
     this.shipmentRepository           = shipmentRepository;
     this.financialGuaranteeRepository = financialGuaranteeRepository;
 }
コード例 #13
0
 public SetIntendedShipmentInfoForNotificationHandler(IwsContext context,
                                                      IShipmentInfoRepository shipmentInfoRepository,
                                                      IFacilityRepository facilityRepository,
                                                      INotificationAssessmentRepository assessmentRepository)
 {
     this.context = context;
     this.shipmentInfoRepository = shipmentInfoRepository;
     this.facilityRepository     = facilityRepository;
     this.assessmentRepository   = assessmentRepository;
 }
コード例 #14
0
 public GetShipmentInfoHandler(INotificationConsentRepository consentRepository,
                               IShipmentInfoRepository shipmentInfoRepository,
                               INotificationApplicationRepository notificationRepository,
                               IMapper mapper)
 {
     this.consentRepository      = consentRepository;
     this.shipmentInfoRepository = shipmentInfoRepository;
     this.notificationRepository = notificationRepository;
     this.mapper = mapper;
 }
コード例 #15
0
 public MovementBlockFactory(IMovementRepository movementRepository,
                             IMovementDetailsRepository movementDetailsRepository,
                             INotificationApplicationRepository notificationApplicationRepository,
                             IShipmentInfoRepository shipmentInfoRepository)
 {
     this.movementRepository = movementRepository;
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.shipmentInfoRepository            = shipmentInfoRepository;
     this.movementDetailsRepository         = movementDetailsRepository;
 }
コード例 #16
0
 public MovementBlockFactory(IMovementRepository movementRepository,
     IMovementDetailsRepository movementDetailsRepository,
     INotificationApplicationRepository notificationApplicationRepository,
     IShipmentInfoRepository shipmentInfoRepository)
 {
     this.movementRepository = movementRepository;
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.shipmentInfoRepository = shipmentInfoRepository;
     this.movementDetailsRepository = movementDetailsRepository;
 }
コード例 #17
0
 public GetMovementReceiptAndRecoveryDataHandler(IMovementRepository movementRepository,
                                                 INotificationApplicationRepository notificationApplicationRepository,
                                                 IMovementRejectionRepository movementRejectionRepository,
                                                 IShipmentInfoRepository shipmentInfoRepository)
 {
     this.movementRepository = movementRepository;
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.movementRejectionRepository       = movementRejectionRepository;
     this.shipmentInfoRepository            = shipmentInfoRepository;
 }
コード例 #18
0
 public NotificationChargeCalculator(IShipmentInfoRepository shipmentInfoRepository,
                                     INotificationApplicationRepository notificationApplicationRepository,
                                     IPricingStructureRepository pricingStructureRepository,
                                     IFacilityRepository facilityRepository,
                                     INumberOfShipmentsHistotyRepository numberOfShipmentsHistotyRepository)
 {
     this.shipmentInfoRepository            = shipmentInfoRepository;
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.pricingStructureRepository        = pricingStructureRepository;
     this.facilityRepository = facilityRepository;
     this.numberOfShipmentsHistotyRepository = numberOfShipmentsHistotyRepository;
 }
コード例 #19
0
 public NotificationChargeCalculator(IShipmentInfoRepository shipmentInfoRepository, 
     INotificationApplicationRepository notificationApplicationRepository,
     IPricingStructureRepository pricingStructureRepository,
     IFacilityRepository facilityRepository,
     INumberOfShipmentsHistotyRepository numberOfShipmentsHistotyRepository)
 {
     this.shipmentInfoRepository = shipmentInfoRepository;
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.pricingStructureRepository = pricingStructureRepository;
     this.facilityRepository = facilityRepository;
     this.numberOfShipmentsHistotyRepository = numberOfShipmentsHistotyRepository;
 }
コード例 #20
0
        public NotificationChargeCalculatorTests()
        {
            notificationId = new Guid("C4C62654-048C-45A2-BF7F-9837EFCF328F");

            shipmentInfoRepository = A.Fake<IShipmentInfoRepository>();
            shipmentInfo = A.Fake<ShipmentInfo>();
            notificationApplicationRepository = A.Fake<INotificationApplicationRepository>();
            pricingStructureRepository = A.Fake<IPricingStructureRepository>();
            facilityRepository = A.Fake<IFacilityRepository>();
            numberOfShipmentsHistotyRepository = A.Fake<INumberOfShipmentsHistotyRepository>();

            notificationApplication = new TestableNotificationApplication();

            chargeCalculator = new NotificationChargeCalculator(shipmentInfoRepository, notificationApplicationRepository, pricingStructureRepository, facilityRepository, numberOfShipmentsHistotyRepository);
        }
コード例 #21
0
        public NotificationChargeCalculatorTests()
        {
            notificationId = new Guid("C4C62654-048C-45A2-BF7F-9837EFCF328F");

            shipmentInfoRepository             = A.Fake <IShipmentInfoRepository>();
            shipmentInfo                       = A.Fake <ShipmentInfo>();
            notificationApplicationRepository  = A.Fake <INotificationApplicationRepository>();
            pricingStructureRepository         = A.Fake <IPricingStructureRepository>();
            facilityRepository                 = A.Fake <IFacilityRepository>();
            numberOfShipmentsHistotyRepository = A.Fake <INumberOfShipmentsHistotyRepository>();

            notificationApplication = new TestableNotificationApplication();

            chargeCalculator = new NotificationChargeCalculator(shipmentInfoRepository, notificationApplicationRepository, pricingStructureRepository, facilityRepository, numberOfShipmentsHistotyRepository);
        }
コード例 #22
0
        public GetRemainingShipmentsHandlerTests()
        {
            SystemTime.Freeze(Today);

            movementRepository           = A.Fake <IMovementRepository>();
            shipmentRepository           = A.Fake <IShipmentInfoRepository>();
            financialGuaranteeRepository = A.Fake <IFinancialGuaranteeRepository>();

            var shipment = new TestableShipmentInfo
            {
                Id                = Guid.NewGuid(),
                NotificationId    = NotificationId,
                NumberOfShipments = MaxNumberOfShipments,
                Quantity          = 10m,
                Units             = ShipmentQuantityUnits.Tonnes
            };

            A.CallTo(() => shipmentRepository.GetByNotificationId(NotificationId)).Returns(shipment);
            A.CallTo(() => movementRepository.GetAllMovements(NotificationId)).Returns(GetShipments(TotalMovements, Today));
            A.CallTo(() => movementRepository.GetAllActiveMovements(NotificationId)).Returns(GetShipments(ActiveMovements, Today));

            handler = new GetRemainingShipmentsHandler(movementRepository, shipmentRepository, financialGuaranteeRepository);
        }
コード例 #23
0
        public MovementQuantityTests()
        {
            movement = new TestableMovement
            {
                Status = MovementStatus.Received,
                Receipt = new TestableMovementReceipt
                {
                    Date = new DateTime(2015, 9, 1),
                    Decision = Core.MovementReceipt.Decision.Accepted,
                    QuantityReceived = new ShipmentQuantity(5, ShipmentQuantityUnits.Kilograms)
                }
            };

            shipmentInfo = new TestableShipmentInfo
            {
                Quantity = 20,
                Units = ShipmentQuantityUnits.Kilograms
            };

            movementRepository = A.Fake<IMovementRepository>();
            shipmentRepository = A.Fake<IShipmentInfoRepository>();

            movementQuantity = new NotificationMovementsQuantity(movementRepository, shipmentRepository);
        }
コード例 #24
0
 public PrenotificationContentQuantityUnitRuleTests()
 {
     shipmentInfoRepository = A.Fake <IShipmentInfoRepository>();
     rule           = new PrenotificationQuantityUnitRule(shipmentInfoRepository);
     notificationId = Guid.NewGuid();
 }
コード例 #25
0
 public NotificationDocumentGenerator(IShipmentInfoRepository shipmentInfoRepository,
                                      NotificationBlocksFactory blocksFactory)
 {
     this.shipmentInfoRepository = shipmentInfoRepository;
     this.blocksFactory          = blocksFactory;
 }
コード例 #26
0
 public NotificationMovementsQuantity(IMovementRepository movementRepository, IShipmentInfoRepository shipmentRepository)
 {
     this.movementRepository = movementRepository;
     this.shipmentRepository = shipmentRepository;
 }
コード例 #27
0
 public GetIntendedShipmentInfoForNotificationHandler(IShipmentInfoRepository shipmentInfoRepository)
 {
     this.shipmentInfoRepository = shipmentInfoRepository;
 }
コード例 #28
0
 public NumberOfMovements(IMovementRepository movementRepository, IShipmentInfoRepository shipmentRepository)
 {
     this.movementRepository = movementRepository;
     this.shipmentRepository = shipmentRepository;
 }
コード例 #29
0
 public ReceiptRecoveryRecoveryQuantityUnitRuleTests()
 {
     shipmentInfoRepository = A.Fake <IShipmentInfoRepository>();
     rule           = new ReceiptRecoveryRecoveryQuantityUnitRule(shipmentInfoRepository);
     notificationId = Guid.NewGuid();
 }
コード例 #30
0
 public SetNewNumberOfShipmentsHandler(IwsContext context, INumberOfShipmentsHistotyRepository shipmentHistotyRepository, IShipmentInfoRepository shipmentInfoRepository)
 {
     this.context = context;
     this.shipmentHistotyRepository = shipmentHistotyRepository;
     this.shipmentInfoRepository    = shipmentInfoRepository;
 }
コード例 #31
0
 public CheckMovementNumberValidHandler(IMovementRepository movementRepository,
                                        IShipmentInfoRepository shipmentInfoRepository)
 {
     this.movementRepository     = movementRepository;
     this.shipmentInfoRepository = shipmentInfoRepository;
 }
コード例 #32
0
 public NumberOfMovements(IMovementRepository movementRepository, IShipmentInfoRepository shipmentRepository)
 {
     this.movementRepository = movementRepository;
     this.shipmentRepository = shipmentRepository;
 }
コード例 #33
0
 public PrenotificationQuantityUnitRule(IShipmentInfoRepository shipmentInfoRepository)
 {
     this.shipmentInfoRepository = shipmentInfoRepository;
 }
コード例 #34
0
 public GetShipmentUnitsHandler(IShipmentInfoRepository repository)
 {
     this.repository = repository;
 }
コード例 #35
0
 public ReceiptRecoveryRecoveryQuantityUnitRule(IShipmentInfoRepository repo)
 {
     this.repo = repo;
 }