コード例 #1
0
        public void Setup()
        {
            _target = new ProviderApproveCohortCommandValidator();

            _command = new ProviderApproveCohortCommand
            {
                Caller             = new Caller(23, CallerType.Provider),
                CommitmentId       = 123,
                LastUpdatedByEmail = "*****@*****.**",
                LastUpdatedByName  = "Someone"
            };
        }
        public void SetUp()
        {
            Validator = new ProviderApproveCohortCommandValidator();
            Command   = new ProviderApproveCohortCommand {
                Caller = new Caller(213, CallerType.Provider), CommitmentId = 123, LastUpdatedByName = "Test", LastUpdatedByEmail = "*****@*****.**", Message = "Some text"
            };
            SetUpCommonMocks();
            Commitment            = CreateCommitment(Command.CommitmentId, 11234, Command.Caller.Id);
            Commitment.EditStatus = EditStatus.ProviderOnly;
            Account = CreateAccount(Commitment.EmployerAccountId, ApprenticeshipEmployerType.Levy);
            CommitmentRepository.Setup(x => x.GetCommitmentById(Command.CommitmentId)).ReturnsAsync(Commitment);
            EmployerAccountsService.Setup(x => x.GetAccount(Commitment.EmployerAccountId)).ReturnsAsync(Account);
            SetupSuccessfulOverlapCheck();
            V2EventsPublisher.Setup(x => x.SendProviderApproveCohortCommand(It.IsAny <long>(), It.IsAny <string>(), It.IsAny <UserInfo>()))
            .Returns(Task.CompletedTask);

            Target = new ProviderApproveCohortCommandHandler(Validator,
                                                             CommitmentRepository.Object,
                                                             V2EventsPublisher.Object);
        }