public PerformBulkUploadContentValidationHandlerTests()
        {
            notificationId = Guid.NewGuid();

            mapper                       = A.Fake <IMap <DataTable, List <PrenotificationMovement> > >();
            repository                   = A.Fake <IDraftMovementRepository>();
            contentRule                  = A.Fake <IPrenotificationContentRule>();
            movementRepository           = A.Fake <IMovementRepository>();
            financialGuaranteeRepository = A.Fake <IFinancialGuaranteeRepository>();

            var contentRules = new List <IPrenotificationContentRule>()
            {
                contentRule
            };

            var testCollection = new TestableFinancialGuaranteeCollection(notificationId)
            {
                FinancialGuarantees = new List <TestableFinancialGuarantee>()
                {
                    new TestableFinancialGuarantee()
                    {
                        ActiveLoadsPermitted = MaxActiveLoads,
                        Status = FinancialGuaranteeStatus.Approved
                    }
                }
            };

            var testFutureActiveMovements = new List <TestableMovement>()
            {
                new TestableMovement()
                {
                    Status = MovementStatus.Submitted,
                    Date   = new DateTime(2019, 1, 1)
                },
                new TestableMovement()
                {
                    Status = MovementStatus.Submitted,
                    Date   = new DateTime(2019, 1, 1)
                },
                new TestableMovement()
                {
                    Status = MovementStatus.Submitted,
                    Date   = new DateTime(2019, 1, 15)
                },
                new TestableMovement()
                {
                    Status = MovementStatus.Submitted,
                    Date   = new DateTime(2019, 1, 15)
                }
            };

            A.CallTo(() => financialGuaranteeRepository.GetByNotificationId(notificationId)).Returns(testCollection);
            A.CallTo(() => movementRepository.GetAllActiveMovements(notificationId))
            .Returns(testFutureActiveMovements);

            handler = new PerformPrenotificationContentValidationHandler(contentRules, mapper, repository, movementRepository, financialGuaranteeRepository);
        }
Beispiel #2
0
 public PerformReceiptRecoveryContentValidationHandler(IEnumerable <IReceiptRecoveryContentRule> contentRules,
                                                       IMap <DataTable, List <ReceiptRecoveryMovement> > mapper,
                                                       IDraftMovementRepository repository,
                                                       IMovementRepository movementRepository)
 {
     this.contentRules       = contentRules;
     this.mapper             = mapper;
     this.repository         = repository;
     this.movementRepository = movementRepository;
 }
Beispiel #3
0
 public PerformPrenotificationContentValidationHandler(IEnumerable <IPrenotificationContentRule> contentRules,
                                                       IMap <DataTable, List <PrenotificationMovement> > mapper,
                                                       IDraftMovementRepository draftRepository,
                                                       IMovementRepository movementRepository,
                                                       IFinancialGuaranteeRepository financialGuaranteeRepository)
 {
     this.contentRules                 = contentRules;
     this.mapper                       = mapper;
     this.draftRepository              = draftRepository;
     this.movementRepository           = movementRepository;
     this.financialGuaranteeRepository = financialGuaranteeRepository;
 }
        public PerformReceiptRecoveryContentValidationHandlerTests()
        {
            mapper             = A.Fake <IMap <DataTable, List <ReceiptRecoveryMovement> > >();
            contentRule        = A.Fake <IReceiptRecoveryContentRule>();
            repository         = A.Fake <IDraftMovementRepository>();
            movementRepository = A.Fake <IMovementRepository>();

            contentRules = new List <IReceiptRecoveryContentRule>(1)
            {
                contentRule
            };

            handler = new PerformReceiptRecoveryContentValidationHandler(contentRules, mapper, repository,
                                                                         movementRepository);
        }
Beispiel #5
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;
 }
 public CreateReceiptRecoveryHandler(IDraftMovementRepository draftMovementRepository,
                                     IMovementRepository movementRepository,
                                     IwsContext context,
                                     IUserContext userContext,
                                     IFileRepository fileRepository,
                                     CertificateFactory certificateFactory,
                                     CertificateOfReceiptNameGenerator receiptNameGenerator,
                                     CertificateOfRecoveryNameGenerator recoveryNameGenerator,
                                     INotificationApplicationRepository notificationRepository,
                                     IMovementAuditRepository movementAuditRepository)
 {
     this.draftMovementRepository = draftMovementRepository;
     this.movementRepository      = movementRepository;
     this.context                 = context;
     this.userContext             = userContext;
     this.fileRepository          = fileRepository;
     this.certificateFactory      = certificateFactory;
     this.receiptNameGenerator    = receiptNameGenerator;
     this.recoveryNameGenerator   = recoveryNameGenerator;
     this.notificationRepository  = notificationRepository;
     this.movementAuditRepository = movementAuditRepository;
 }