internal EditApprenticeshipRequestToViewModelMapperTestsFixture SetApprenticeshipStatus(ApprenticeshipStatus status)
 {
     ApprenticeshipResponse.Status = status;
     return(this);
 }
        private bool IsEndDateLocked(bool isLockedForUpdate, bool hasHadDataLockSuccess, ApprenticeshipStatus status)
        {
            var result = isLockedForUpdate;

            if (hasHadDataLockSuccess)
            {
                result = status == ApprenticeshipStatus.WaitingToStart;
            }

            return(result);
        }
        public async Task IsLockedForUpdate_Is_Mapped_With_ApprenticeshipStatus_And_IsFundedByTransfer_And_HasDataLockSuccess_Condition(ApprenticeshipStatus status, bool hasHadDataLockSuccess, bool expectedIsLockedForUpdated)
        {
            _fixture.AsTransferSender()
            .IsWithInFundingPeriod()
            .SetApprenticeshipStatus(status)
            .SetDataLockSuccess(hasHadDataLockSuccess);

            //Act
            var viewModel = await _fixture.Map();

            //Assert
            Assert.AreEqual(expectedIsLockedForUpdated, viewModel.IsLockedForUpdate);
        }
Beispiel #4
0
 private void AssertStatus(Api.Types.Apprenticeship.Facets result, ApprenticeshipStatus status, int i)
 {
     result.ApprenticeshipStatuses.Count(m => m.Data == status).Should().Be(i);
 }
Beispiel #5
0
 public DetailsViewModelMapperFixture WithApprenticeshipStatus(
     ApprenticeshipStatus status)
 {
     ApiResponse.Status = status;
     return(this);
 }
Beispiel #6
0
        public async Task WhenApprenticeStatusThenShowChangeEmployerLinkIsMappedCorrectly(ApprenticeshipStatus apprenticeshipStatus, bool expected)
        {
            //Arrange
            _fixture
            .WithApprenticeshipStatus(apprenticeshipStatus)
            .WithoutNextApprenticeship();

            //Act
            await _fixture.Map();

            //Assert
            Assert.AreEqual(expected, _fixture.Result.ShowChangeEmployerLink);
        }
Beispiel #7
0
        public async Task When_HandlingCompletionEventWithIncorrectStatus_WarningMessageIsLogged(ApprenticeshipStatus status)
        {
            _fixture.WithApprenticeshipStatus(status);
            await _fixture.Handle();

            _fixture.VerifyHasWarning();
        }
Beispiel #8
0
            public RecordedAct1CompletionPaymentEventHandlerTestsFixture WithApprenticeshipStatus(ApprenticeshipStatus status)
            {
                switch (status)
                {
                case ApprenticeshipStatus.Live:
                    _apprenticeship.PaymentStatus = PaymentStatus.Active;
                    _apprenticeship.StartDate     = _event.EventTime.UtcDateTime.AddMonths(-6);
                    break;

                case ApprenticeshipStatus.WaitingToStart:
                    _apprenticeship.PaymentStatus = PaymentStatus.Active;
                    _apprenticeship.StartDate     = _event.EventTime.UtcDateTime.AddMonths(6);
                    break;

                case ApprenticeshipStatus.Completed:
                    _apprenticeship.PaymentStatus = PaymentStatus.Completed;
                    break;

                case ApprenticeshipStatus.Paused:
                    _apprenticeship.PaymentStatus = PaymentStatus.Paused;
                    break;

                case ApprenticeshipStatus.Stopped:
                    _apprenticeship.PaymentStatus = PaymentStatus.Withdrawn;
                    break;
                }

                return(this);
            }