Beispiel #1
0
        public void WhenMonthlyPaymentProcessRunsForTheFollowingIlrData(Table table)
        {
            // Setup reference data
            var environmentVariables = EnvironmentVariablesFactory.GetEnvironmentVariables();

            SetupContexLearners(table);

            var provider = StepDefinitionsContext.GetDefaultProvider();

            provider.Ukprn = long.Parse(table.Rows[0]["UKPRN"]);
            var learner = provider.Learners[0];


            var startDate = StepDefinitionsContext.GetIlrStartDate().NextCensusDate();

            SetupValidLearnersData(provider.Ukprn, learner);

            var dueAmount = learner.LearningDelivery.PriceEpisodes[0].TotalPrice * 0.8m / 12;


            EarningsDataHelper.SavePeriodisedValuesForUkprn(provider.Ukprn,
                                                            learner.LearnRefNumber,
                                                            new Dictionary <int, decimal> {
                { 1, dueAmount }
            },
                                                            learner.LearningDelivery.PriceEpisodes[0].Id,
                                                            environmentVariables);

            //Run the month end
            RunMonthEnd(startDate);
        }
Beispiel #2
0
        public void WhenAPaymentIsDue(decimal dueAmount)
        {
            // Setup reference data
            var environmentVariables = EnvironmentVariablesFactory.GetEnvironmentVariables();
            var provider             = StepDefinitionsContext.GetDefaultProvider();
            var learner = provider.Learners[0];

            //save the periodiosed values
            EarningsDataHelper.SavePeriodisedValuesForUkprn(StepDefinitionsContext.GetDefaultProvider().Ukprn,
                                                            learner.LearnRefNumber,
                                                            new Dictionary <int, decimal> {
                { 1, dueAmount }
            },
                                                            learner.LearningDelivery.PriceEpisodes[0].Id,
                                                            environmentVariables);

            RunMonthEnd(new DateTime(2017, 09, 01));
        }