コード例 #1
0
        public static void ManyApproved_And_Very_Large_Cohort_Ready_For_Employer()
        {
            for (var i = 0; i < 15; i++)
            {
                var builder = new CohortBuilder();

                builder
                .WithDefaultEmployerProvider()
                .WithParty(Party.None)
                .WithApprovals(Party.Employer | Party.Provider)
                .WithApprenticeshipPaymentStatus(PaymentStatus.Active)
                .WithApprenticeships(1000);
                builder.Build();
            }

            var builder2 = new CohortBuilder();

            builder2
            .WithDefaultEmployerProvider()
            .WithParty(Party.Employer)
            .WithApprovals(Party.Provider)
            .WithLastAction(LastAction.Approve)
            .WithApprenticeships(1);
            builder2.Build();
        }
コード例 #2
0
        public static void Apprentice_Stopped_And_Restarted_NonLevy()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultProvider()
            .WithNonLevyEmployer()
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithLastAction(LastAction.Approve)
            .WithApprenticeshipPaymentStatus(PaymentStatus.Stopped)
            .WithApprenticeship(cohort =>
                                new ApprenticeshipBuilder(builder)
                                .WithUln("1000001880")
                                .WithStartOption(new DateTime(2018, 6, 1))
                                .WithStopOption(new DateTime(2018, 6, 1))
                                );
            builder.Build();


            builder = new CohortBuilder();
            builder
            .WithDefaultProvider()
            .WithNonLevyEmployer()
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithLastAction(LastAction.Approve)
            .WithApprenticeshipPaymentStatus(PaymentStatus.Active)
            .WithApprenticeship(cohort =>
                                new ApprenticeshipBuilder(builder)
                                .WithUln("1000001880")
                                .WithStartOption(new DateTime(2018, 6, 1))
                                );
            builder.Build();
        }
コード例 #3
0
        public static void TwoApprovedApprenticeshipsWithSameUln()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultEmployerProvider()
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithLastAction(LastAction.Approve)
            .WithApprenticeshipPaymentStatus(PaymentStatus.Active)
            .WithApprenticeship(cohort =>
                                new ApprenticeshipBuilder(builder)
                                .WithUln("1000001880")
                                .WithStartOption(new DateTime(2018, 6, 1))
                                .WithEndOption(new DateTime(2019, 6, 23))
                                .WithStopOption(new DateTime(2018, 9, 12))
                                );
            builder.Build();


            builder = new CohortBuilder();
            builder
            .WithDefaultEmployerProvider()
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithLastAction(LastAction.Approve)
            .WithApprenticeshipPaymentStatus(PaymentStatus.Active)
            .WithApprenticeship(cohort =>
                                new ApprenticeshipBuilder(builder)
                                .WithUln("1000001880")
                                .WithStartOption(new DateTime(2018, 9, 1))
                                );
            builder.Build();
        }
コード例 #4
0
        public static void ReusingUlnWhenPendingWithSender()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultEmployerProvider()
            .WithTransferSender(8194, "Mega Corp", TransferApprovalStatus.Pending)
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithLastAction(LastAction.Approve)
            .WithApprenticeshipPaymentStatus(PaymentStatus.PendingApproval)
            .WithApprenticeship(cohort =>
                                new ApprenticeshipBuilder(builder)
                                .WithUln("1000001880")
                                .WithStartOption(new DateTime(2018, 6, 1))
                                );
            builder.Build();


            builder = new CohortBuilder();
            builder
            .WithDefaultEmployerProvider()
            .WithParty(Party.Employer)
            .WithLastAction(LastAction.None)
            .WithApprenticeshipPaymentStatus(PaymentStatus.PendingApproval)
            .WithApprenticeship(cohort =>
                                new ApprenticeshipBuilder(builder)
                                .WithUln("1000001880")
                                .WithStartOption(new DateTime(2018, 9, 1))
                                );
            builder.Build();
        }
コード例 #5
0
        public static void Scenario_Cohort_Sent_to_new_Provider()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultEmployerProvider()
            .WithParty(Party.Provider)
            .WithLastAction(LastAction.Amend)
            .WithApprenticeship(cohort => new ApprenticeshipBuilder(builder));
            builder.Build();
        }
コード例 #6
0
        public static void Scenario_Cohort_Sent_to_existing_Provider()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultEmployerProvider()
            .WithParty(Party.Provider)
            .WithLastAction(LastAction.Amend)
            .WithLastUpdatedByEmployer("Chris", "*****@*****.**")
            .WithApprenticeship(cohort => new ApprenticeshipBuilder(builder));
            builder.Build();
        }
コード例 #7
0
        public static void Scenario_Very_Large_Cohort_Ready_For_Employer()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultEmployerProvider()
            .WithParty(Party.Employer)
            .WithApprovals(Party.Provider)
            .WithLastAction(LastAction.Approve)
            .WithApprenticeships(500);
            builder.Build();
        }
コード例 #8
0
        public static void Scenario_Cohort_Employer_Draft()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultProvider()
            .WithDefaultEmployer()
            .WithParty(Party.Employer)
            .WithLastAction(LastAction.None)
            .WithApprenticeships(10);
            builder.Build();
        }
コード例 #9
0
        public static void Scenario_Fully_Approved_Cohort()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultEmployerProvider()
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithLastAction(LastAction.Approve)
            .WithApprenticeshipPaymentStatus(PaymentStatus.Active)
            .WithApprenticeships(1);
            builder.Build();
        }
コード例 #10
0
        public static void Scenario_Cohort_Provider_ReadyForApproval()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultProvider()
            .WithDefaultEmployer()
            .WithParty(Party.Provider)
            .WithApprovals(Party.Employer)
            .WithLastAction(LastAction.Amend)
            .WithApprenticeships(10);
            builder.Build();
        }
コード例 #11
0
        public static void Scenario_Transfer_Cohort_Employer_Draft()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultProvider()
            .WithNonLevyEmployer()
            .WithParty(Party.Employer)
            .WithLastAction(LastAction.None)
            .WithTransferSender(8194, "Mega Corp", null)
            .WithApprenticeships(10);
            builder.Build();
        }
コード例 #12
0
        public static void Scenario_Cohort_Approved_And_Sent_to_existing_Provider()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultEmployerProvider()
            .WithParty(Party.Provider)
            .WithApprovals(Party.Employer)
            .WithLastAction(LastAction.Approve)
            .WithLastUpdatedByEmployer("Chris", "*****@*****.**")
            .WithApprenticeships(1000);
            builder.Build();
        }
コード例 #13
0
        public static void Scenario_Fully_Approved_Cohort_With_Provider_Removed_From_ROATP()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultEmployer()
            .WithProvider(99999999, "Bad Provider")
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithApprenticeshipPaymentStatus(PaymentStatus.Active)
            .WithApprenticeships(50);
            builder.Build();
        }
コード例 #14
0
        public static void Scenario_Transfer_Cohort_NonLevy_Employer()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultProvider()
            .WithNonLevyEmployer()
            .WithParty(Party.Employer)
            .WithApprovals(Party.Provider)
            .WithLastAction(LastAction.Approve)
            .WithTransferSender(8194, "Mega Corp", null)
            .WithApprenticeship(cohort => new ApprenticeshipBuilder(builder));
            builder.Build();
        }
コード例 #15
0
        public static void Scenario_Transfer_Cohort_Rejected_By_Sender()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultProvider()
            .WithNonLevyEmployer()
            .WithParty(Party.Employer)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithLastAction(LastAction.Approve)
            .WithTransferSender(8194, "Mega Corp", TransferApprovalStatus.Rejected)
            .WithApprenticeships(10);
            builder.Build();
        }
コード例 #16
0
        public static void Scenario_Fully_Approved_Transfer_Cohort()
        {
            var builder = new CohortBuilder();

            builder
            .WithNonLevyEmployer()
            .WithDefaultProvider()
            .WithTransferSender(8194, "Mega Corp", TransferApprovalStatus.Approved)
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider | Party.TransferSender)
            .WithLastAction(LastAction.Approve)
            .WithApprenticeshipPaymentStatus(PaymentStatus.Active)
            .WithApprenticeships(50);
            builder.Build();
        }
コード例 #17
0
        public static void Scenario_Transfer_Cohort_Pending_With_Sender_With_FundingBands()
        {
            var builder = new CohortBuilder();

            builder
            .WithNonLevyEmployer()
            .WithDefaultProvider()
            .WithParty(Party.TransferSender)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithLastAction(LastAction.Approve)
            .WithTransferSender(8194, "Mega Corp", TransferApprovalStatus.Pending)     //todo: refactor this so that status is based on being with transfer sender
            .WithApprenticeships(10)
            .WithFundingCapWarning();
            builder.Build();
        }
コード例 #18
0
        public static void SingleApproved()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultEmployerProvider()
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithLastAction(LastAction.Approve)
            .WithApprenticeshipPaymentStatus(PaymentStatus.Active)
            .WithApprenticeship(cohort =>
                                new ApprenticeshipBuilder(builder).WithStartOption(new DateTime(2018, 9, 1)));

            builder.Build();
        }
コード例 #19
0
        public static void Scenario_Multiple_Approved_Apprenticeships_Employers_And_Providers()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultEmployer()
            .WithDefaultProvider()
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithApprenticeshipPaymentStatus(PaymentStatus.Active)
            .WithLastAction(LastAction.Approve)
            .WithApprenticeships(1);
            builder.Build();

            builder = new CohortBuilder();

            builder
            .WithDefaultEmployer()
            .WithProvider(10005077, "Train-U-Good Corporation")
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithApprenticeshipPaymentStatus(PaymentStatus.Active)
            .WithLastAction(LastAction.Approve)
            .WithApprenticeships(1);
            builder.Build();

            builder = new CohortBuilder();
            builder
            .WithEmployer(30060, "06344082", "Rapid Logistics Co Ltd", "7EKPG7", 645, ApprenticeshipEmployerType.NonLevy)
            .WithDefaultProvider()
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithApprenticeshipPaymentStatus(PaymentStatus.Active)
            .WithLastAction(LastAction.Approve)
            .WithApprenticeships(1);
            builder.Build();

            builder = new CohortBuilder();
            builder
            .WithEmployer(30060, "06344082", "Rapid Logistics Co Ltd", "7EKPG7", 645, ApprenticeshipEmployerType.NonLevy)
            .WithProvider(10005077, "Train-U-Good Corporation")
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithApprenticeshipPaymentStatus(PaymentStatus.Active)
            .WithLastAction(LastAction.Approve)
            .WithApprenticeships(1);
            builder.Build();
        }
コード例 #20
0
        public static void Scenario_Transfer_Cohort_Pending_With_Sender()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultProvider()
            .WithNonLevyEmployer()
            .WithParty(Party.TransferSender)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithLastAction(LastAction.Approve)
            .WithApprenticeshipPaymentStatus(PaymentStatus.PendingApproval, DateTime.UtcNow)
            .WithTransferSender(8194, "Mega Corp", TransferApprovalStatus.Pending)
            .WithLastUpdatedByEmployer("Chris Foster Employer User", "*****@*****.**")
            .WithLastUpdatedByProvider("Chris Foster Provider User", "*****@*****.**")
            .WithApprenticeships(10);
            builder.Build();
        }
コード例 #21
0
        public static void CourseDataLockWithoutDataLockSuccess()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultEmployerProvider()
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithLastAction(LastAction.Approve)
            .WithApprenticeshipPaymentStatus(PaymentStatus.Active)
            .WithApprenticeship(cohort =>
                                new ApprenticeshipBuilder(builder)
                                .WithStartOption(ApprenticeshipStartedOption.Started)
                                .WithDataLock(DataLockType.Course)
                                );
            builder.Build();
        }
コード例 #22
0
        public static void ManyApprovedNonLevy()
        {
            for (var i = 0; i < 500; i++)
            {
                var builder = new CohortBuilder();

                if (RandomHelper.GetRandomNumber(10) > 8)
                {
                    builder
                    .WithNonLevyEmployer()
                    .WithDefaultProvider()
                    .WithParty(Party.None)
                    .WithApprovals(Party.Employer | Party.Provider)
                    .WithLastAction(LastAction.Approve)
                    .WithApprenticeshipPaymentStatus(PaymentStatus.Active)
                    .WithApprenticeships(1);
                }
                else
                {
                    DataLockType datalockType = DataLockType.Course;
                    var          r            = RandomHelper.GetRandomNumber(3);
                    if (r == 1)
                    {
                        datalockType = DataLockType.Price;
                    }

                    if (r == 2)
                    {
                        datalockType = DataLockType.MultiPrice;
                    }

                    builder
                    .WithNonLevyEmployer()
                    .WithDefaultProvider()
                    .WithParty(Party.None)
                    .WithApprovals(Party.Employer | Party.Provider)
                    .WithLastAction(LastAction.Approve)
                    .WithApprenticeshipPaymentStatus(PaymentStatus.Active)
                    .WithApprenticeship(cohort =>
                                        new ApprenticeshipBuilder(builder)
                                        .WithDataLock(datalockType));
                }

                builder.Build();
            }
        }
コード例 #23
0
        private static void CreateAFewApprovedApprenticesForProvider(int providerId, string providerName)
        {
            var approvalDateTime = DateTime.UtcNow.Date.AddDays(-100);

            for (var i = 0; i < 3; i++)
            {
                var builder = new CohortBuilder();
                builder
                .WithDefaultEmployer()
                .WithProvider(providerId, providerName)
                .WithParty(Party.None)
                .WithApprovals(Party.Employer | Party.Provider)
                .WithLastAction(LastAction.Approve)
                .WithApprenticeshipPaymentStatus(PaymentStatus.Active, DataHelper.GetRandomDateTime())
                .WithApprenticeships(3);
                builder.Build();
            }
        }
コード例 #24
0
        public static void Cohort_Provider_Draft(int size, bool nonLevyEmployer)
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultProvider()
            .WithDefaultEmployer()
            .WithParty(Party.Provider)
            .WithIsDraft(true)
            .WithApprenticeships(size);

            if (nonLevyEmployer)
            {
                builder.WithNonLevyEmployer();
            }

            builder.Build();
        }
コード例 #25
0
        public static void Scenario_Fully_Approved_Apprentices_Pending_DataLock_Success()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultEmployerProvider()
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithLastAction(LastAction.Approve)
            .WithApprenticeshipPaymentStatus(PaymentStatus.Active)
            .WithApprenticeship(cohort =>
                                new ApprenticeshipBuilder(builder)
                                .WithStartOption(ApprenticeshipStartedOption.Started))
            .WithApprenticeship(cohort =>
                                new ApprenticeshipBuilder(builder)
                                .WithStartOption(ApprenticeshipStartedOption.WaitingToStart))
            .Build();
        }
コード例 #26
0
        public static void Single_Stopped_Apprentice()
        {
            var builder = new CohortBuilder();

            builder
            .WithNonLevyEmployer()
            .WithDefaultProvider()
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithApprenticeship(cohort =>
                                new ApprenticeshipBuilder(builder)
                                .WithUln("1000001880")
                                .WithStartOption(new DateTime(2019, 6, 1))
                                .WithEndOption(new DateTime(2020, 6, 1))
                                .WithStopOption(new DateTime(2020, 2, 1))
                                );
            builder.Build();
        }
コード例 #27
0
        public static void NonLevy_PendingChangeOfCircumstances_ProviderOriginated()
        {
            var builder = new CohortBuilder();

            builder
            .WithNonLevyEmployer()
            .WithDefaultProvider()
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithLastAction(LastAction.Approve)
            .WithApprenticeshipPaymentStatus(PaymentStatus.Active)
            .WithApprenticeship(cohort =>
                                new ApprenticeshipBuilder(builder)
                                .WithStartOption(ApprenticeshipStartedOption.Started)
                                .WithChangeOfCircumstances(Originator.Provider)
                                );
            builder.Build();
        }
コード例 #28
0
        public static void Apprentice_Stopped_NonLevy_Transfer()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultProvider()
            .WithNonLevyEmployer()
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider | Party.TransferSender)
            .WithLastAction(LastAction.Approve)
            .WithTransferSender(8194, "Mega Corp", TransferApprovalStatus.Approved)
            .WithApprenticeshipPaymentStatus(PaymentStatus.Cancelled)
            .WithApprenticeship(cohort =>
                                new ApprenticeshipBuilder(builder)
                                .WithStartOption(new DateTime(2019, 6, 1))
                                .WithStopOption(new DateTime(2020, 3, 1))
                                );
            builder.Build();
        }
コード例 #29
0
        public static void Scenario_NonLevy_Employer_Many_Cohorts()
        {
            CohortBuilder builder;

            for (var i = 0; i < 100; i++)
            {
                builder = new CohortBuilder();

                builder
                .WithDefaultProvider()
                .WithNonLevyEmployer()
                .WithParty(Party.Employer)
                .WithApprovals(Party.Provider)
                .WithLastAction(LastAction.Approve)
                .WithApprenticeship(cohort => new ApprenticeshipBuilder(builder))
                .WithMessages(10);
                builder.Build();
            }
        }
コード例 #30
0
        public static void Single_Complete_NonLevy()
        {
            var builder = new CohortBuilder();

            builder
            .WithDefaultProvider()
            .WithNonLevyEmployer()
            .WithParty(Party.None)
            .WithApprovals(Party.Employer | Party.Provider)
            .WithLastAction(LastAction.Approve)
            .WithIsDraft(false)
            .WithApprenticeshipPaymentStatus(PaymentStatus.Completed)
            .WithApprenticeship(cohort =>
                                new ApprenticeshipBuilder(builder)
                                .WithStartOption(new DateTime(2019, 2, 1))
                                .WithCompletionOption(new DateTime(2020, 04, 01)));

            builder.Build();
        }