Exemplo n.º 1
0
 public CopyToNotificationHandler(IwsContext context,
                                  NotificationToNotificationCopy copier,
                                  ExporterToExporterCopy exporterCopier,
                                  TransportRouteToTransportRouteCopy transportRouteCopier,
                                  WasteRecoveryToWasteRecoveryCopy wasteRecoveryCopier,
                                  ImporterToImporterCopy importerCopier,
                                  INotificationApplicationRepository notificationApplicationRepository,
                                  IIntraCountryExportAllowedRepository intraCountryExportAllowedRepository,
                                  FacilityCollectionCopy facilityCopier,
                                  CarrierCollectionCopy carrierCopier,
                                  ProducerCollectionCopy producerCopier,
                                  MeansOfTransportToMeansOfTransportCopy meansOfTransportCopier)
 {
     this.context              = context;
     this.copier               = copier;
     this.exporterCopier       = exporterCopier;
     this.transportRouteCopier = transportRouteCopier;
     this.wasteRecoveryCopier  = wasteRecoveryCopier;
     this.importerCopier       = importerCopier;
     this.notificationApplicationRepository   = notificationApplicationRepository;
     this.intraCountryExportAllowedRepository = intraCountryExportAllowedRepository;
     this.facilityCopier         = facilityCopier;
     this.carrierCopier          = carrierCopier;
     this.producerCopier         = producerCopier;
     this.meansOfTransportCopier = meansOfTransportCopier;
 }
Exemplo n.º 2
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>());
        }
Exemplo n.º 3
0
        public SetMultipleMovementFileIdHandlerTests()
        {
            var context = new TestIwsContext();

            context.Users.Add(UserFactory.Create(TestIwsContext.UserId, AnyString, AnyString, AnyString, AnyString));

            notificationId = Guid.NewGuid();
            fileId         = Guid.NewGuid();
            var userId = TestIwsContext.UserId;

            movementRepository      = A.Fake <IMovementRepository>();
            notificationRepository  = A.Fake <INotificationApplicationRepository>();
            fileRepository          = A.Fake <IFileRepository>();
            movementAuditRepository = A.Fake <IMovementAuditRepository>();
            var userContext = A.Fake <IUserContext>();

            A.CallTo(() => notificationRepository.GetById(notificationId))
            .Returns(new TestableNotificationApplication()
            {
                NotificationNumber = NotificatioNumber
            });

            A.CallTo(() => fileRepository.Store(A <File> .Ignored)).Returns(fileId);

            A.CallTo(() => userContext.UserId).Returns(userId);

            handler = new SetMultipleMovementFileIdHandler(context, movementRepository, notificationRepository,
                                                           fileRepository, movementAuditRepository, userContext);
        }
 public GeneralBlockFactory(INotificationApplicationRepository notificationApplicationRepository,
     IShipmentInfoRepository shipmentInfoRepository, IFacilityRepository facilityRepository)
 {
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.shipmentInfoRepository = shipmentInfoRepository;
     this.facilityRepository = facilityRepository;
 }
 public ReceiptRecoveryRecoveryDateFormatRuleTests()
 {
     notificationRepo = A.Fake <INotificationApplicationRepository>();
     rule             = new ReceiptRecoveryRecoveryDateFormatRule(notificationRepo);
     notificationId   = Guid.NewGuid();
     A.CallTo(() => notificationRepo.GetById(notificationId)).Returns(A.Fake <NotificationApplication>());
 }
        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>());
        }
        public CertificateOfReceiptNameTests()
        {
            notificationApplicationRepository = A.Fake <INotificationApplicationRepository>();
            notificationId = new Guid("6CE221A8-F8EC-4EDD-A2D7-33B8836B9BBF");

            certificateOfReceiptName = new CertificateOfReceiptNameGenerator(notificationApplicationRepository);
        }
Exemplo n.º 8
0
        public SaveMovementCompletedReceiptHandlerTests()
        {
            var context = new TestIwsContext();

            context.Users.Add(UserFactory.Create(TestIwsContext.UserId, AnyString, AnyString, AnyString, AnyString));

            notificationId = Guid.NewGuid();
            movementId     = Guid.NewGuid();
            fileId         = Guid.NewGuid();

            var userContext = A.Fake <IUserContext>();

            movementRepository      = A.Fake <IMovementRepository>();
            fileRepository          = A.Fake <IFileRepository>();
            notificationRepository  = A.Fake <INotificationApplicationRepository>();
            movementAuditRepository = A.Fake <IMovementAuditRepository>();

            A.CallTo(() => notificationRepository.GetById(notificationId))
            .Returns(new TestableNotificationApplication()
            {
                NotificationNumber = NotificationNumber
            });

            A.CallTo(() => fileRepository.Store(A <File> .Ignored)).Returns(fileId);

            var nameGenerator      = new CertificateOfRecoveryNameGenerator(notificationRepository);
            var certificateFactory = new CertificateFactory();

            handler = new SaveMovementCompletedReceiptHandler(context, fileRepository, movementRepository,
                                                              certificateFactory, nameGenerator, userContext, notificationRepository, movementAuditRepository);
        }
Exemplo n.º 9
0
 public GeneralBlockFactory(INotificationApplicationRepository notificationApplicationRepository,
                            IShipmentInfoRepository shipmentInfoRepository, IFacilityRepository facilityRepository)
 {
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.shipmentInfoRepository            = shipmentInfoRepository;
     this.facilityRepository = facilityRepository;
 }
Exemplo n.º 10
0
        public GetWasteCodeLookupAndNotificationDataByTypesHandlerTests()
        {
            wasteCodeRepository = A.Fake <IWasteCodeRepository>();
            notificationApplicationRepository = A.Fake <INotificationApplicationRepository>();
            //var context = new TestIwsContext();

            handler = new GetWasteCodeLookupAndNotificationDataByTypesHandler(notificationApplicationRepository, wasteCodeRepository, new WasteCodeMap(), new WasteCodeMap());

            A.CallTo(() => wasteCodeRepository.GetAllWasteCodes()).Returns(wasteCodes);

            var notificationWithWasteCodes = new TestableNotificationApplication
            {
                Id         = NotificationWithWasteCodesId,
                WasteCodes = new WasteCodeInfo[]
                {
                    new TestableWasteCodeInfo(FirstBaselCode)
                }
            };

            A.CallTo(() => notificationApplicationRepository.GetById(NotificationWithWasteCodesId)).Returns(notificationWithWasteCodes);

            var notificationWithoutWasteCodes = new TestableNotificationApplication
            {
                Id = NotificationWithoutWasteCodesId
            };

            A.CallTo(() => notificationApplicationRepository.GetById(NotificationWithoutWasteCodesId)).Returns(notificationWithoutWasteCodes);
        }
        public CertificateOfReceiptNameTests()
        {
            notificationApplicationRepository = A.Fake<INotificationApplicationRepository>();
            notificationId = new Guid("6CE221A8-F8EC-4EDD-A2D7-33B8836B9BBF");

            certificateOfReceiptName = new CertificateOfReceiptNameGenerator(notificationApplicationRepository);
        }
Exemplo n.º 12
0
 public SetPreconsentedRecoveryFacilityHandler(IwsContext context,
                                               INotificationApplicationRepository notificationApplicationRepository,
                                               SetAllFacilitiesPreconsented setAllFacilitiesPreconsented)
 {
     this.context = context;
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.setAllFacilitiesPreconsented      = setAllFacilitiesPreconsented;
 }
        public ReceiptRecoveryNotificationNumberRuleTests()
        {
            repository = A.Fake <INotificationApplicationRepository>();

            rule               = new ReceiptRecoveryNotificationNumberRule(repository);
            notificationId     = Guid.NewGuid();
            notificationNumber = Guid.NewGuid().ToString();
        }
        public GetWasteRecoveryProviderHandlerTests()
        {
            notification = new TestableNotificationApplication { Id = NotificationId };
            repository = A.Fake<INotificationApplicationRepository>();
            A.CallTo(() => repository.GetById(NotificationId)).Returns(notification);

            handler = new GetWasteRecoveryProviderHandler(repository);
        }
 public WasteRecoveryBlockFactory(INotificationApplicationRepository notificationApplicationRepository,
     IWasteRecoveryRepository wasteRecoveryRepository,
     IWasteDisposalRepository wasteDisposalRepository)
 {
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.wasteRecoveryRepository = wasteRecoveryRepository;
     this.wasteDisposalRepository = wasteDisposalRepository;
 }
Exemplo n.º 16
0
 public GetReceivedMovementsHandler(IMovementRepository movementRepository,
                                    INotificationApplicationRepository notificationRepository,
                                    IMapper mapper)
 {
     this.movementRepository     = movementRepository;
     this.notificationRepository = notificationRepository;
     this.mapper = mapper;
 }
Exemplo n.º 17
0
 public WasteRecoveryBlockFactory(INotificationApplicationRepository notificationApplicationRepository,
                                  IWasteRecoveryRepository wasteRecoveryRepository,
                                  IWasteDisposalRepository wasteDisposalRepository)
 {
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.wasteRecoveryRepository           = wasteRecoveryRepository;
     this.wasteDisposalRepository           = wasteDisposalRepository;
 }
Exemplo n.º 18
0
 public ConsentPeriod(INotificationConsentRepository consentRepository,
     IWorkingDayCalculator workingDayCalculator,
     INotificationApplicationRepository notificationApplicationRepository)
 {
     this.consentRepository = consentRepository;
     this.workingDayCalculator = workingDayCalculator;
     this.notificationApplicationRepository = notificationApplicationRepository;
 }
Exemplo n.º 19
0
 public ConsentPeriod(INotificationConsentRepository consentRepository,
                      IWorkingDayCalculator workingDayCalculator,
                      INotificationApplicationRepository notificationApplicationRepository)
 {
     this.consentRepository    = consentRepository;
     this.workingDayCalculator = workingDayCalculator;
     this.notificationApplicationRepository = notificationApplicationRepository;
 }
 public PrenotificationContentThreeWorkingDaysRule(INotificationConsentRepository consentRepository,
                                                   IWorkingDayCalculator workingDayCalculator,
                                                   INotificationApplicationRepository notificationApplicationRepository)
 {
     this.consentRepository    = consentRepository;
     this.workingDayCalculator = workingDayCalculator;
     this.notificationApplicationRepository = notificationApplicationRepository;
 }
Exemplo n.º 21
0
 public GetFinancialGuaranteeDataByNotificationApplicationIdHandler(
     IMapWithParameter <FinancialGuarantee, UKCompetentAuthority, FinancialGuaranteeData> financialGuaranteeMap,
     IFinancialGuaranteeRepository financialGuaranteeRepository,
     INotificationApplicationRepository notificationApplicationRepository)
 {
     this.financialGuaranteeMap             = financialGuaranteeMap;
     this.financialGuaranteeRepository      = financialGuaranteeRepository;
     this.notificationApplicationRepository = notificationApplicationRepository;
 }
Exemplo n.º 22
0
        public ReceiptRecoveryShipmentMustBePrenotifiedRuleTests()
        {
            movementRepo     = A.Fake <IMovementRepository>();
            notificationRepo = A.Fake <INotificationApplicationRepository>();
            rule             = new ReceiptRecoveryShipmentMustBePrenotifiedRule(movementRepo, notificationRepo);
            notificationId   = Guid.NewGuid();

            A.CallTo(() => notificationRepo.GetById(notificationId)).Returns(A.Fake <NotificationApplication>());
        }
 public GetExportKeyDatesOverrideDataHandler(IKeyDatesOverrideRepository repository,
                                             INotificationAssessmentRepository assessmentRepository,
                                             INotificationApplicationRepository applicationRepository,
                                             DecisionRequiredBy decisionRequiredBy)
 {
     this.repository            = repository;
     this.assessmentRepository  = assessmentRepository;
     this.applicationRepository = applicationRepository;
     this.decisionRequiredBy    = decisionRequiredBy;
 }
Exemplo n.º 24
0
        public ReceiptRecoveryAlreadyRecoveredRuleTests()
        {
            this.movementRepo     = A.Fake <IMovementRepository>();
            this.notificationRepo = A.Fake <INotificationApplicationRepository>();

            rule           = new ReceiptRecoveryAlreadyRecoveredRule(this.movementRepo, this.notificationRepo);
            notificationId = Guid.NewGuid();

            A.CallTo(() => this.notificationRepo.GetById(notificationId)).Returns(A.Fake <NotificationApplication>());
        }
Exemplo n.º 25
0
 public MovementBlockFactory(IMovementRepository movementRepository,
                             IMovementDetailsRepository movementDetailsRepository,
                             INotificationApplicationRepository notificationApplicationRepository,
                             IShipmentInfoRepository shipmentInfoRepository)
 {
     this.movementRepository = movementRepository;
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.shipmentInfoRepository            = shipmentInfoRepository;
     this.movementDetailsRepository         = movementDetailsRepository;
 }
 public MovementBlockFactory(IMovementRepository movementRepository,
     IMovementDetailsRepository movementDetailsRepository,
     INotificationApplicationRepository notificationApplicationRepository,
     IShipmentInfoRepository shipmentInfoRepository)
 {
     this.movementRepository = movementRepository;
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.shipmentInfoRepository = shipmentInfoRepository;
     this.movementDetailsRepository = movementDetailsRepository;
 }
Exemplo n.º 27
0
 public GetMovementReceiptAndRecoveryDataHandler(IMovementRepository movementRepository,
                                                 INotificationApplicationRepository notificationApplicationRepository,
                                                 IMovementRejectionRepository movementRejectionRepository,
                                                 IShipmentInfoRepository shipmentInfoRepository)
 {
     this.movementRepository = movementRepository;
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.movementRejectionRepository       = movementRejectionRepository;
     this.shipmentInfoRepository            = shipmentInfoRepository;
 }
Exemplo n.º 28
0
 public GetWasteCodeLookupAndNotificationDataByTypesHandler(INotificationApplicationRepository notificationApplicationRepository,
                                                            IWasteCodeRepository wasteCodeRepository,
                                                            IMap <IEnumerable <WasteCode>, WasteCodeData[]> wasteCodeMapper,
                                                            IMap <IEnumerable <WasteCodeInfo>, WasteCodeData[]> wasteCodeInfoMapper)
 {
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.wasteCodeRepository = wasteCodeRepository;
     this.wasteCodeMapper     = wasteCodeMapper;
     this.wasteCodeInfoMapper = wasteCodeInfoMapper;
 }
Exemplo n.º 29
0
 public GetNotificationInfoHandler(INotificationApplicationRepository notificationApplicationRepository,
                                   INotificationAssessmentRepository notificationAssessmentRepository,
                                   IImportNotificationRepository importNotificationRepository,
                                   IImportNotificationAssessmentRepository importNotificationAssessmentRepository)
 {
     this.notificationApplicationRepository      = notificationApplicationRepository;
     this.notificationAssessmentRepository       = notificationAssessmentRepository;
     this.importNotificationRepository           = importNotificationRepository;
     this.importNotificationAssessmentRepository = importNotificationAssessmentRepository;
 }
Exemplo n.º 30
0
        public SetOperationCodesHandlerTests()
        {
            this.context = new TestIwsContext();
            this.notificationRepository = A.Fake <INotificationApplicationRepository>();

            A.CallTo(() => notificationRepository.GetById(A <Guid> .Ignored)).Returns(GetFakeApplication());

            this.message = A.Fake <SetOperationCodes>();
            this.handler = new SetOperationCodesHandler(this.context, this.notificationRepository);
        }
Exemplo n.º 31
0
        public GetWasteRecoveryProviderHandlerTests()
        {
            notification = new TestableNotificationApplication {
                Id = NotificationId
            };
            repository = A.Fake <INotificationApplicationRepository>();
            A.CallTo(() => repository.GetById(NotificationId)).Returns(notification);

            handler = new GetWasteRecoveryProviderHandler(repository);
        }
Exemplo n.º 32
0
 public MovementDocumentGenerator(ICarrierRepository carrierRepository,
                                  IMovementDetailsRepository movementDetailsRepository,
                                  INotificationApplicationRepository notificationApplicationRepository,
                                  MovementBlocksFactory blocksFactory)
 {
     this.blocksFactory                     = blocksFactory;
     this.movementDetailsRepository         = movementDetailsRepository;
     this.carrierRepository                 = carrierRepository;
     this.notificationApplicationRepository = notificationApplicationRepository;
 }
Exemplo n.º 33
0
 public UpdatedMovementDateValidator(IMovementDateValidator movementDateValidator,
                                     OriginalMovementDate originalMovementDate,
                                     IWorkingDayCalculator workingDayCalculator,
                                     INotificationApplicationRepository notificationRepository)
 {
     this.originalMovementDate   = originalMovementDate;
     this.workingDayCalculator   = workingDayCalculator;
     this.notificationRepository = notificationRepository;
     this.movementDateValidator  = movementDateValidator;
 }
Exemplo n.º 34
0
 public GetShipmentInfoHandler(INotificationConsentRepository consentRepository,
                               IShipmentInfoRepository shipmentInfoRepository,
                               INotificationApplicationRepository notificationRepository,
                               IMapper mapper)
 {
     this.consentRepository      = consentRepository;
     this.shipmentInfoRepository = shipmentInfoRepository;
     this.notificationRepository = notificationRepository;
     this.mapper = mapper;
 }
Exemplo n.º 35
0
        public PrenotificationNotificationNumberRuleTests()
        {
            notificationId = Guid.NewGuid();

            notificationApplicationRepository = A.Fake <INotificationApplicationRepository>();

            A.CallTo(() => notificationApplicationRepository.GetNumber(notificationId)).Returns(NotificationNumber);

            rule = new PrenotificationNotificationNumberRule(notificationApplicationRepository);
        }
 public GetCurrentFinancialGuaranteeDetailsHandler(
     IMapWithParameter <FinancialGuarantee, UKCompetentAuthority, FinancialGuaranteeData> financialGuaranteeMap,
     IFinancialGuaranteeRepository financialGuaranteeRepository,
     INotificationApplicationRepository notificationApplicationRepository,
     INotificationAssessmentRepository assessmentRepository)
 {
     this.financialGuaranteeMap             = financialGuaranteeMap;
     this.financialGuaranteeRepository      = financialGuaranteeRepository;
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.assessmentRepository = assessmentRepository;
 }
        public ReceiptRecoveryRecoveryMustBeInPastRuleTests()
        {
            notificationRepo   = A.Fake <INotificationApplicationRepository>();
            movementRepository = A.Fake <IMovementRepository>();
            rule           = new ReceiptRecoveryRecoveryDateInFutureRule(notificationRepo, movementRepository);
            notificationId = Guid.NewGuid();

            A.CallTo(() => notificationRepo.GetById(notificationId)).Returns(A.Fake <NotificationApplication>());
            A.CallTo(() => movementRepository.GetAllMovements(notificationId))
            .Returns(GetRepoMovements(true, SystemTime.UtcNow.AddDays(-10)));
        }
 public NotificationAssessmentDatesSummaryRepository(DecisionRequiredBy decisionRequiredBy,
     INotificationAssessmentRepository notificationAssessmentRepository,
     INotificationApplicationRepository notificationApplicationRepository,
     INotificationTransactionCalculator transactionCalculator,
     INotificationApplicationAuthorization authorization)
 {
     this.decisionRequiredBy = decisionRequiredBy;
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.notificationAssessmentRepository = notificationAssessmentRepository;
     this.transactionCalculator = transactionCalculator;
     this.authorization = authorization;
 }
 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;
 }
        public SetWasteRecoveryProviderHandlerTests()
        {
            context = new TestIwsContext();
            repository = A.Fake<INotificationApplicationRepository>();

            var notification = new TestableNotificationApplication
            {
                Id = NotificationId
            };

            context.NotificationApplications.Add(notification);
            A.CallTo(() => repository.GetById(NotificationId)).Returns(notification);

            handler = new SetWasteRecoveryProviderHandler(repository, context);
        }
        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);
        }
        public MovementDateValidatorTests()
        {
            consentRepository = A.Fake<INotificationConsentRepository>();
            notificationRepository = A.Fake<INotificationApplicationRepository>();
            historyRepository = A.Fake<IMovementDateHistoryRepository>();
            workingDayCalculator = A.Fake<IWorkingDayCalculator>();

            dateValidator = new MovementDateValidator(consentRepository);
            originalMovementDate = new OriginalMovementDate(historyRepository);
            updatedDateValidator = new UpdatedMovementDateValidator(dateValidator,
                originalMovementDate,
                workingDayCalculator,
                notificationRepository);

            SystemTime.Freeze(Today.AddHours(5));

            A.CallTo(() => consentRepository.GetByNotificationId(NotificationId))
                .Returns(new Consent(
                    NotificationId,
                    new DateRange(ConsentStart, ConsentEnd),
                    AnyString,
                    AnyGuid));

            A.CallTo(() => notificationRepository.GetByMovementId(A<Guid>.Ignored))
                .Returns(new NotificationApplication(
                    AnyGuid,
                    NotificationType.Recovery,
                    UKCompetentAuthority.England,
                    10));

            A.CallTo(() => historyRepository.GetByMovementId(A<Guid>.Ignored))
                .Returns(new MovementDateHistory[0]);

            A.CallTo(() => workingDayCalculator.AddWorkingDays(A<DateTime>.Ignored,
                A<int>.Ignored,
                A<bool>.Ignored,
                A<UKCompetentAuthority>.Ignored))
                    .ReturnsLazily((DateTime inputDate,
                        int inputDays,
                        bool includeStartDay,
                        UKCompetentAuthority ca) =>
                            //A very simple working day formula that ignores bank holidays taken from http://stackoverflow.com/a/279370
                            inputDate.AddDays(inputDays
                                + ((inputDays / 5) * 2)
                                + ((((int)inputDate.DayOfWeek + (inputDays % 5)) >= 5) ? 2 : 0)));
        }
 public InterimMovementDocumentGenerator(INotificationApplicationRepository notificationApplicationRepository)
 {
     this.notificationApplicationRepository = notificationApplicationRepository;
 }
Exemplo n.º 44
0
 public RequiredAnnexes(INotificationApplicationRepository notificationRepository,
     ITechnologyEmployedRepository technologyEmployedRepository)
 {
     this.notificationRepository = notificationRepository;
     this.technologyEmployedRepository = technologyEmployedRepository;
 }
 public WasteCompositionBlockFactory(INotificationApplicationRepository notificationApplicationRepository)
 {
     this.notificationApplicationRepository = notificationApplicationRepository;
 }
 public MovementOperationBlockFactory(INotificationApplicationRepository notificationApplicationRepository,
     ITechnologyEmployedRepository technologyEmployedRepository)
 {
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.technologyEmployedRepository = technologyEmployedRepository;
 }
 public MovementWasteCodesBlockFactory(INotificationApplicationRepository notificationApplicationRepository)
 {
     this.notificationApplicationRepository = notificationApplicationRepository;
 }
 public MovementFileNameGenerator(INotificationApplicationRepository notificationApplicationRepository)
 {
     this.notificationApplicationRepository = notificationApplicationRepository;
 }
 public ChangeNotificationUser(INotificationApplicationRepository repository)
 {
     this.repository = repository;
 }
 public CertificateOfRecoveryNameGenerator(INotificationApplicationRepository notificationRepository)
 {
     this.notificationRepository = notificationRepository;
 }
 public SpecialHandlingBlockFactory(INotificationApplicationRepository notificationApplicationRepository)
 {
     this.notificationApplicationRepository = notificationApplicationRepository;
 }
 public ProducerBlockFactory(INotificationApplicationRepository notificationApplicationRepository,
     IProducerRepository producerRepository)
 {
     this.notificationApplicationRepository = notificationApplicationRepository;
     this.producerRepository = producerRepository;
 }
 public CertificateOfRecoveryNameTests()
 {
     notificationRepository = A.Fake<INotificationApplicationRepository>();
     notificationId = new Guid("231208B0-7341-415E-9396-014AEBB0D3E1");
     certificateOfRecoveryName = new CertificateOfRecoveryNameGenerator(notificationRepository);
 }