Exemplo n.º 1
0
        public void Arrange()
        {
            var autoFixture = new Fixture();

            _accountApiClient.Setup(x => x.GetLegalEntitiesConnectedToAccount(ExpectedAccountId))
            .ReturnsAsync(new List <ResourceViewModel>());
            _employerAccountsService = new EmployerAccountsService(_accountApiClient.Object);
            _legalEntityViewModel    = autoFixture.Create <LegalEntityViewModel>();
        }
        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);
        }