예제 #1
0
        protected void SetupReferenceData()
        {
            foreach (var employer in StepDefinitionsContext.ReferenceDataContext.Employers)
            {
                AccountDataHelper.CreateAccount(employer.AccountId, employer.AccountId.ToString(), 0.00m, EnvironmentVariables);
            }

            AccountDataHelper.UpdateAudit(EnvironmentVariables);

            foreach (var provider in StepDefinitionsContext.Providers)
            {
                foreach (var learner in provider.Learners)
                {
                    AddLearnerCommitment(provider.Ukprn, learner, provider.Name);
                }
            }

            CommitmentDataHelper.UpdateEventStreamPointer(EnvironmentVariables);
        }
예제 #2
0
        protected void SetupPeriodReferenceData(DateTime date)
        {
            AccountDataHelper.ClearAccounts(EnvironmentVariables);
            CommitmentDataHelper.ClearCommitments(EnvironmentVariables);

            var period = date.GetPeriod();

            if (StepDefinitionsContext.DasScenario)
            {
                foreach (var employer in StepDefinitionsContext.ReferenceDataContext.Employers)
                {
                    AccountDataHelper.CreateAccount(
                        employer.AccountId,
                        employer.AccountId.ToString(),
                        employer.GetBalanceForMonth(period),
                        EnvironmentVariables);
                }

                AccountDataHelper.UpdateAudit(EnvironmentVariables);
            }

            foreach (var provider in StepDefinitionsContext.Providers)
            {
                foreach (var learner in provider.Learners)
                {
                    if (learner.LearningDelivery.LearnerType == LearnerType.ProgrammeOnlyNonDas)
                    {
                        continue;
                    }

                    AddLearnerCommitmentsForPeriod(date, provider.Ukprn, learner, provider.Name);
                }
            }

            CommitmentDataHelper.UpdateEventStreamPointer(EnvironmentVariables);
        }