public void GivenStatusIsPausedReturnDataLockErrors() { var validation = new DataLockValidationModel { PriceEpisode = new PriceEpisode { Identifier = PriceEpisodeIdentifier }, EarningPeriod = period, Apprenticeship = new ApprenticeshipModel { Id = 1, Status = ApprenticeshipStatus.Paused, ApprenticeshipPriceEpisodes = new List <ApprenticeshipPriceEpisodeModel> { new ApprenticeshipPriceEpisodeModel() } } }; var validator = new ApprenticeshipPauseValidator(); var result = validator.Validate(validation); result.DataLockErrorCode.Should().Be(DataLockErrorCode.DLOCK_12); result.ApprenticeshipPriceEpisodes.Should().BeEmpty(); }
public void ShouldNotMatchRemovedApprenticeshipPriceEpisodes() { var validation = new DataLockValidationModel { PriceEpisode = new PriceEpisode { Identifier = PriceEpisodeIdentifier }, EarningPeriod = period, Apprenticeship = new ApprenticeshipModel { Id = 1, Status = ApprenticeshipStatus.Active, ApprenticeshipPriceEpisodes = new List <ApprenticeshipPriceEpisodeModel> { new ApprenticeshipPriceEpisodeModel { Removed = true } } }, }; var validator = new ApprenticeshipPauseValidator(); var result = validator.Validate(validation); result.DataLockErrorCode.Should().BeNull(); result.ApprenticeshipPriceEpisodes.Should().BeEmpty(); }
public void WhenStatusIsNotPauseReturnNoDataLockErrors() { var validation = new DataLockValidationModel { PriceEpisode = new PriceEpisode { Identifier = PriceEpisodeIdentifier }, EarningPeriod = period, Apprenticeship = new ApprenticeshipModel { Id = 1, ApprenticeshipPriceEpisodes = new List <ApprenticeshipPriceEpisodeModel> { new ApprenticeshipPriceEpisodeModel { Id = 100 } } } }; var validator = new ApprenticeshipPauseValidator(); var result = validator.Validate(validation); result.DataLockErrorCode.Should().BeNull(); result.ApprenticeshipPriceEpisodes.Should().HaveCount(1); result.ApprenticeshipPriceEpisodes[0].Id.Should().Be(100); }