public void WhenStandardCodeDoesNotMatch_ThenDLOCK_03() { var validation = new DataLockValidationModel { PriceEpisode = new PriceEpisode { Identifier = PriceEpisodeIdentifier }, EarningPeriod = period, Apprenticeship = new ApprenticeshipModel { Id = 1, ApprenticeshipPriceEpisodes = new List <ApprenticeshipPriceEpisodeModel> { new ApprenticeshipPriceEpisodeModel { Id = 100 } }, StandardCode = 123, }, Aim = new LearningAim { StandardCode = 124, }, }; var validator = new StandardCodeValidator(); var result = validator.Validate(validation); result.DataLockErrorCode.Should().Be(DataLockErrorCode.DLOCK_03); result.ApprenticeshipPriceEpisodes.Should().HaveCount(0); }
public void WhenStandardCodeMatches_ThenNoDatalock() { var validation = new DataLockValidationModel { PriceEpisode = new PriceEpisode { Identifier = PriceEpisodeIdentifier }, EarningPeriod = period, Apprenticeship = new ApprenticeshipModel { Id = 1, ApprenticeshipPriceEpisodes = new List <ApprenticeshipPriceEpisodeModel> { new ApprenticeshipPriceEpisodeModel { Id = 100 } }, StandardCode = 123, }, Aim = new LearningAim { StandardCode = 123, }, }; var validator = new StandardCodeValidator(); var result = validator.Validate(validation); result.DataLockErrorCode.Should().BeNull(); result.ApprenticeshipPriceEpisodes.Should().HaveCount(1); result.ApprenticeshipPriceEpisodes[0].Id.Should().Be(100); }