Пример #1
0
        public void EmployerSendsToProviderToAddApprentices(RequestStatus expectedResult, AgreementStatus agreementStatus, EditStatus editStatus, int numberOfApprenticeships, LastAction lastAction)
        {
            // Scenario 1
            var status = _calculator.GetStatus(editStatus, numberOfApprenticeships, lastAction, agreementStatus);

            status.Should().Be(expectedResult);
        }
        public async Task <CommitmentListItemViewModel> MapToCommitmentListItemViewModelAsync(CommitmentListItem commitment, Func <CommitmentListItem, Task <string> > latestMessageFunc)
        {
            var messageTask = latestMessageFunc.Invoke(commitment);

            return(new CommitmentListItemViewModel
            {
                HashedCommitmentId = _hashingService.HashValue(commitment.Id),
                Name = commitment.Reference,
                LegalEntityName = commitment.LegalEntityName,
                ProviderName = commitment.ProviderName,
                Status = _statusCalculator.GetStatus(commitment.EditStatus, commitment.ApprenticeshipCount, commitment.LastAction, commitment.AgreementStatus),
                ShowViewLink = commitment.EditStatus == EditStatus.EmployerOnly,
                LatestMessage = await messageTask
            });
        }
        public CommitmentSummaryViewModel MapToCommitmentSummaryViewModel(Commitment commitment)
        {
            var agremmentStatus = _commitmentRules.DetermineAgreementStatus(commitment.Apprenticeships);
            var status          = _statusCalculator.GetStatus(commitment.EditStatus,
                                                              commitment.Apprenticeships.Count,
                                                              commitment.LastAction,
                                                              agremmentStatus,
                                                              commitment.TransferSenderId,
                                                              commitment.TransferApprovalStatus);

            return(new CommitmentSummaryViewModel
            {
                CohortReference = _hashingService.HashValue(commitment.Id),
                HashedAccountId = _hashingService.HashValue(commitment.EmployerAccountId),
                EmployerName = commitment.LegalEntityName,
                ProviderName = commitment.ProviderName,
                ProviderUkprn = commitment.ProviderId,
                CohortStatusText = status.GetEnumDescription()
            });
        }
        public void WhenThereAreNoApprentices(RequestStatus expectedResult, LastAction lastAction)
        {
            var status = _calculator.GetStatus(EditStatus.ProviderOnly, 0, lastAction, AgreementStatus.NotAgreed);

            status.Should().Be(expectedResult);
        }