Example #1
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);
        }
Example #2
0
        public SetMovementRejectedHandlerTests()
        {
            var context = new TestIwsContext();

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

            notificationId = Guid.NewGuid();
            movementId     = Guid.NewGuid();
            rejectDate     = SystemTime.UtcNow;

            rejectMovement          = A.Fake <IRejectMovement>();
            movementRepository      = A.Fake <IMovementRepository>();
            fileRepository          = A.Fake <IFileRepository>();
            movementAuditRepository = A.Fake <IMovementAuditRepository>();
            var notificationRepository = A.Fake <INotificationApplicationRepository>();
            var nameGenerator          = new MovementFileNameGenerator(notificationRepository);
            var certificateFactory     = new CertificateFactory();
            var userContext            = A.Fake <IUserContext>();

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

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

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

            handler = new SetMovementRejectedHandler(rejectMovement, movementRepository, context, nameGenerator,
                                                     certificateFactory, fileRepository, movementAuditRepository, userContext);
        }
Example #3
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);
        }
Example #4
0
 public SetMovementAcceptedHandler(IMovementRepository movementRepository, IwsContext context,
                                   IUserContext userContext, IMovementAuditRepository movementAuditRepository)
 {
     this.movementRepository      = movementRepository;
     this.context                 = context;
     this.userContext             = userContext;
     this.movementAuditRepository = movementAuditRepository;
 }
Example #5
0
        public GetMovementAuditByNotificationIdHandlerTests()
        {
            notificationId = Guid.NewGuid();

            mapper     = A.Fake <IMapper>();
            repository = A.Fake <IMovementAuditRepository>();

            handler = new GetMovementAuditByNotificationIdHandler(mapper, repository);
        }
Example #6
0
 public CancelMovementsHandler(IwsContext context, IMovementRepository repository,
                               IMovementAuditRepository movementAuditRepository,
                               IUserContext userContext,
                               ICapturedMovementFactory capturedMovementFactory)
 {
     this.repository = repository;
     this.context    = context;
     this.movementAuditRepository = movementAuditRepository;
     this.userContext             = userContext;
     this.capturedMovementFactory = capturedMovementFactory;
 }
Example #7
0
 public UpdateMovementDateHandler(IMovementRepository repository,
                                  IUpdatedMovementDateValidator validator,
                                  IwsContext context,
                                  IMovementAuditRepository movementAuditRepository,
                                  IUserContext userContext)
 {
     this.repository = repository;
     this.context    = context;
     this.validator  = validator;
     this.movementAuditRepository = movementAuditRepository;
     this.userContext             = userContext;
 }
Example #8
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;
 }
Example #9
0
 public SetMultipleMovementFileIdHandler(IwsContext context,
                                         IMovementRepository movementRepository,
                                         INotificationApplicationRepository notificationRepository,
                                         IFileRepository fileRepository,
                                         IMovementAuditRepository movementAuditRepository,
                                         IUserContext userContext)
 {
     this.context                 = context;
     this.movementRepository      = movementRepository;
     this.notificationRepository  = notificationRepository;
     this.fileRepository          = fileRepository;
     this.movementAuditRepository = movementAuditRepository;
     this.userContext             = userContext;
 }
        public SetMovementAcceptedHandlerTests()
        {
            var context = new TestIwsContext();

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

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

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

            movementAuditRepository = A.Fake <IMovementAuditRepository>();

            handler = new SetMovementAcceptedHandler(movementRepository, context, userContext, movementAuditRepository);
        }
Example #11
0
        public UpdateMovementDateHandlerTests()
        {
            var context = new TestIwsContext();

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

            notificationId = Guid.NewGuid();

            var validator = A.Fake <IUpdatedMovementDateValidator>();

            repository = A.Fake <IMovementRepository>();
            movementAuditRepository = A.Fake <IMovementAuditRepository>();
            var userContext = A.Fake <IUserContext>();

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

            handler = new UpdateMovementDateHandler(repository, validator, context, movementAuditRepository, userContext);
        }
Example #12
0
 public SaveMovementCompletedReceiptHandler(IwsContext context,
                                            IFileRepository fileRepository,
                                            IMovementRepository movementRepository,
                                            CertificateFactory certificateFactory,
                                            CertificateOfRecoveryNameGenerator nameGenerator,
                                            IUserContext userContext,
                                            INotificationApplicationRepository notificationRepository,
                                            IMovementAuditRepository movementAuditRepository)
 {
     this.context                 = context;
     this.fileRepository          = fileRepository;
     this.movementRepository      = movementRepository;
     this.certificateFactory      = certificateFactory;
     this.nameGenerator           = nameGenerator;
     this.userContext             = userContext;
     this.notificationRepository  = notificationRepository;
     this.movementAuditRepository = movementAuditRepository;
 }
 public SetMovementRejectedHandler(IRejectMovement rejectMovement,
                                   IMovementRepository movementRepository,
                                   IwsContext context,
                                   MovementFileNameGenerator nameGenerator,
                                   CertificateFactory certificateFactory,
                                   IFileRepository fileRepository,
                                   IMovementAuditRepository movementAuditRepository,
                                   IUserContext userContext)
 {
     this.rejectMovement          = rejectMovement;
     this.movementRepository      = movementRepository;
     this.context                 = context;
     this.nameGenerator           = nameGenerator;
     this.certificateFactory      = certificateFactory;
     this.fileRepository          = fileRepository;
     this.movementAuditRepository = movementAuditRepository;
     this.userContext             = userContext;
 }
Example #14
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;
 }
Example #15
0
        public CancelMovementsHandlerTests()
        {
            notificationId = Guid.NewGuid();
            var userId = TestIwsContext.UserId;

            var context = new TestIwsContext();

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

            repository = A.Fake <IMovementRepository>();
            movementAuditRepository = A.Fake <IMovementAuditRepository>();
            var userContext = A.Fake <IUserContext>();

            capturedMovementFactory = A.Fake <ICapturedMovementFactory>();

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

            handler = new CancelMovementsHandler(context, repository, movementAuditRepository, userContext,
                                                 capturedMovementFactory);
        }
 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;
 }
 public GetMovementAuditByNotificationIdHandler(IMapper mapper, IMovementAuditRepository repository)
 {
     this.mapper     = mapper;
     this.repository = repository;
 }
Example #18
0
 public AuditMovementHandler(IwsContext context, IMovementAuditRepository repository, IMapper mapper)
 {
     this.context    = context;
     this.repository = repository;
     this.mapper     = mapper;
 }