Beispiel #1
0
        public void WhenApprenticeshipIsNotEmployerALevyPayerButTransferReceiverReturnNoDataLockErrors()
        {
            var validation = new DataLockValidationModel
            {
                PriceEpisode = new PriceEpisode
                {
                    Identifier = PriceEpisodeIdentifier
                },
                EarningPeriod  = period,
                Apprenticeship = new ApprenticeshipModel
                {
                    Id          = 1,
                    IsLevyPayer = false,
                    AccountId   = 50,
                    TransferSendingEmployerAccountId = 100,
                    ApprenticeshipPriceEpisodes      = new List <ApprenticeshipPriceEpisodeModel>
                    {
                        new ApprenticeshipPriceEpisodeModel
                        {
                            Id = 100
                        }
                    }
                }
            };

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

            result.DataLockErrorCode.Should().BeNull();
            result.ApprenticeshipPriceEpisodes.Should().HaveCount(1);
            result.ApprenticeshipPriceEpisodes[0].Id.Should().Be(100);
        }
Beispiel #2
0
        public void GivenApprenticeshipEmployerIsNotALevyPayerReturnDataLock_11()
        {
            var validation = new DataLockValidationModel
            {
                PriceEpisode = new PriceEpisode {
                    Identifier = PriceEpisodeIdentifier
                },
                EarningPeriod  = period,
                Apprenticeship = new ApprenticeshipModel
                {
                    Id          = 1,
                    IsLevyPayer = false,
                    ApprenticeshipPriceEpisodes = new List <ApprenticeshipPriceEpisodeModel>
                    {
                        new ApprenticeshipPriceEpisodeModel()
                    }
                }
            };

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

            result.DataLockErrorCode.Should().Be(DataLockErrorCode.DLOCK_11);
            result.ApprenticeshipPriceEpisodes.Should().BeEmpty();
        }