Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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;
 }
Ejemplo n.º 3
0
 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 CertificateOfRecoveryNameTests()
 {
     notificationRepository = A.Fake<INotificationApplicationRepository>();
     notificationId = new Guid("231208B0-7341-415E-9396-014AEBB0D3E1");
     certificateOfRecoveryName = new CertificateOfRecoveryNameGenerator(notificationRepository);
 }
 public CertificateOfRecoveryNameTests()
 {
     notificationRepository    = A.Fake <INotificationApplicationRepository>();
     notificationId            = new Guid("231208B0-7341-415E-9396-014AEBB0D3E1");
     certificateOfRecoveryName = new CertificateOfRecoveryNameGenerator(notificationRepository);
 }