コード例 #1
0
 public CreateMovementInternalHandler(ICapturedMovementFactory factory,
                                      IMovementRepository movementRepository,
                                      IwsContext context)
 {
     this.factory            = factory;
     this.movementRepository = movementRepository;
     this.context            = context;
 }
コード例 #2
0
        public CreateMovementInternalHandlerTests()
        {
            context = new TestIwsContext();
            factory = A.Fake<ICapturedMovementFactory>();
            movementRepository = A.Fake<IMovementRepository>();

            handler = new CreateMovementInternalHandler(factory, movementRepository, context);
        }
コード例 #3
0
        public CapturedMovementFactoryTests()
        {
            validator = A.Fake<IMovementNumberValidator>();
            assessmentRepository = A.Fake<INotificationAssessmentRepository>();

            A.CallTo(() => assessmentRepository.GetByNotificationId(NotificationId))
                .Returns(new TestableNotificationAssessment { Status = NotificationStatus.Consented });

            factory = new CapturedMovementFactory(validator, assessmentRepository, A.Fake<IUserContext>());
        }
コード例 #4
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;
 }
コード例 #5
0
        public CapturedMovementFactoryTests()
        {
            SystemTime.Freeze(Today);
            validator            = A.Fake <IMovementNumberValidator>();
            assessmentRepository = A.Fake <INotificationAssessmentRepository>();

            A.CallTo(() => assessmentRepository.GetByNotificationId(NotificationId))
            .Returns(new TestableNotificationAssessment {
                Status = NotificationStatus.Consented
            });

            factory = new CapturedMovementFactory(validator, assessmentRepository, A.Fake <IUserContext>());
        }
コード例 #6
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);
        }