public void GivenAgreedPriceMatchReturnNoDataLockErrors()
        {
            var validation = new DataLockValidationModel
            {
                PriceEpisode = new PriceEpisode {
                    AgreedPrice = Price, Identifier = PriceEpisodeIdentifier
                },
                EarningPeriod  = period,
                Apprenticeship = new ApprenticeshipModel
                {
                    ApprenticeshipPriceEpisodes = new List <ApprenticeshipPriceEpisodeModel>
                    {
                        new ApprenticeshipPriceEpisodeModel {
                            Cost = Price + 10, Id = 97
                        },
                        new ApprenticeshipPriceEpisodeModel {
                            Cost = Price, Id = 98
                        },
                        new ApprenticeshipPriceEpisodeModel {
                            Cost = Price + 20, Id = 99
                        }
                    }
                }
            };

            var validator = new NegotiatedPriceValidator();
            var result    = validator.Validate(validation);

            result.DataLockErrorCode.Should().BeNull();
        }
        public void ShouldNotMatchRevmovedApprenticeshipPriceEpisodes()
        {
            var validation = new DataLockValidationModel
            {
                PriceEpisode = new PriceEpisode {
                    AgreedPrice = Price, Identifier = PriceEpisodeIdentifier
                },
                EarningPeriod  = period,
                Apprenticeship = new ApprenticeshipModel
                {
                    ApprenticeshipPriceEpisodes = new List <ApprenticeshipPriceEpisodeModel>
                    {
                        new ApprenticeshipPriceEpisodeModel {
                            Cost = Price, Id = 98
                        },
                        new ApprenticeshipPriceEpisodeModel {
                            Cost = Price, Id = 99, Removed = true
                        }
                    }
                }
            };

            var validator = new NegotiatedPriceValidator();
            var result    = validator.Validate(validation);

            result.ApprenticeshipPriceEpisodes.Any(ape => ape.Id == 98).Should().BeTrue();
            result.ApprenticeshipPriceEpisodes.Should().HaveCount(1);
        }
        public void GivenAgreedPriceDoNotMatchReturnDataLockError07()
        {
            var validation = new DataLockValidationModel
            {
                PriceEpisode = new PriceEpisode {
                    AgreedPrice = Price, Identifier = PriceEpisodeIdentifier
                },
                EarningPeriod  = period,
                Apprenticeship = new ApprenticeshipModel
                {
                    ApprenticeshipPriceEpisodes = new List <ApprenticeshipPriceEpisodeModel>
                    {
                        new ApprenticeshipPriceEpisodeModel
                        {
                            Cost = 200
                        }
                    }
                }
            };

            var validator = new NegotiatedPriceValidator();

            var result = validator.Validate(validation);

            result.DataLockErrorCode.Should().Be(DataLockErrorCode.DLOCK_07);
        }