public void SetUp()
        {
            _commitmentRepository     = new Mock <ICommitmentRepository>();
            _apprenticeshipRepository = new Mock <IApprenticeshipRepository>();
            _validator            = new ApprenticeshipStatusChangeCommandValidator();
            _currentDateTime      = new Mock <ICurrentDateTime>();
            _apprenticeshipEvents = new Mock <IApprenticeshipEvents>();
            _commitmentsLogger    = new Mock <ICommitmentsLogger>();
            _historyRepository    = new Mock <IHistoryRepository>();
            _v2EventsPublisher    = new Mock <IV2EventsPublisher>();

            _pauseApprenticeshipHandler = new PauseApprenticeshipCommandHandler(
                _commitmentRepository.Object,
                _apprenticeshipRepository.Object,
                _validator,
                _currentDateTime.Object,
                _apprenticeshipEvents.Object,
                _commitmentsLogger.Object,
                _historyRepository.Object,
                _v2EventsPublisher.Object
                );

            TestCommitment = new Commitment
            {
                EmployerAccountId = 1
            };

            TestApprenticeship = new Apprenticeship
            {
                PaymentStatus = PaymentStatus.Active
            };

            _currentDateTime.Setup(t => t.Now).Returns(DateTime.Now);
        }
示例#2
0
        public virtual void SetUp()
        {
            MockCommitmentRespository     = new Mock <ICommitmentRepository>();
            MockApprenticeshipRespository = new Mock <IApprenticeshipRepository>();
            MockEventsApi         = new Mock <IApprenticeshipEvents>();
            MockHistoryRepository = new Mock <IHistoryRepository>();
            MockCurrentDateTime   = new Mock <ICurrentDateTime>();
            MockCommitmentsLogger = new Mock <ICommitmentsLogger>();

            Handler = new PauseApprenticeshipCommandHandler(
                MockCommitmentRespository.Object,
                MockApprenticeshipRespository.Object,
                new ApprenticeshipStatusChangeCommandValidator(),
                MockCurrentDateTime.Object,
                MockEventsApi.Object,
                MockCommitmentsLogger.Object,
                MockHistoryRepository.Object);
        }