示例#1
0
 public void Setup()
 {
     _validator      = new ApprenticeshipStatusChangeCommandValidator();
     _exampleCommand = new PauseApprenticeshipCommand {
         AccountId = 1L, ApprenticeshipId = 444L
     };
 }
        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);
        }