public void AgedUnder16()
        {
            // under 16 is automatically eligible, but need legal parent/guardian details
            var next   = new StartBestStartGrant().Execute();
            var formId = next.Id;

            next = AddConsent(next);
            next = AddUKVerify(next);
            next = AddApplicantDetails(next, ad => { ad.Under16(TestNowUtc.Value); ad.NationalInsuranceNumber = null; });
            next = AddExpectedChildren(next);
            next = AddExistingChildren(next);

            next.Section.Should().Be(Sections.GuardianDetails, "under 16 should be prompted for their parent's/guardian's details");

            next = AddGuardianDetails(next);

            next.Section.Should().Be(Sections.HealthProfessional, "under 16 should not be prompted for applicant benefits");

            next = AddHealthProfessional(next);
            next = AddPaymentDetails(next);
            next = AddEvidence(next);
            next = AddDeclaration(next);

            VerifyComplete(next);
        }
        public void Aged18PartOfGuardianPartnerBenefits()
        {
            // 18, living with parents, and guardian's partner has a qualifying benefit
            var next   = new StartBestStartGrant().Execute();
            var formId = next.Id;

            next = AddConsent(next);
            next = AddUKVerify(next);
            next = AddApplicantDetails(next, ad => ad.PartOfGuardianBenefits(TestNowUtc.Value));
            next = AddExpectedChildren(next);
            next = AddExistingChildren(next);

            next.Section.Should().Be(Sections.GuardianBenefits, "18/19 should confirm the benefits their guardian's partner is on");
            next = AddGuardianBenefits(next, b => b.None());

            next.Section.Should().Be(Sections.GuardianPartnerBenefits, "when guardian does not have a qualifying benefit, should be prompted for the guardian's partner's benefits");
            next = AddGuardianPartnerBenefits(next);

            next = AddGuardianPartnerDetails(next);
            next = AddHealthProfessional(next);
            next = AddPaymentDetails(next);
            next = AddEvidence(next);
            next = AddDeclaration(next);

            VerifyComplete(next);
        }
示例#3
0
        public ActionResult BeforeYouApply(object notUsed)
        {
            var cmd = new StartBestStartGrant();

            return(Exec(cmd,
                        success: next => RedirectNext(next),
                        failure: () => View()));
        }
        public void NoChildren_Ineligible()
        {
            var next   = new StartBestStartGrant().Execute();
            var formId = next.Id;

            next = AddConsent(next);
            next = AddUKVerify(next);
            next = AddApplicantDetails(next, ad => ad.Over25(TestNowUtc.Value));
            next = AddExpectedChildren(next, ec => ec.NoBabyExpected());
            next = AddExistingChildren(next, 0);

            VerifyIneligible(next);
        }
        public void Execute_CreatesForm()
        {
            var cmd = new StartBestStartGrant();

            var nextSection = cmd.Execute();

            var createdForm = Repository.Load <BestStartGrant>(nextSection.Id);

            createdForm.Should().NotBeNull("form should be in database");

            nextSection.Type.Should().Be(NextType.Section);
            nextSection.Section.Should().Be(Navigation.Order.First());
        }
        public void NoBenefits_Ineligible()
        {
            var next   = new StartBestStartGrant().Execute();
            var formId = next.Id;

            next = AddConsent(next);
            next = AddUKVerify(next);
            next = AddApplicantDetails(next);
            next = AddExpectedChildren(next);
            next = AddExistingChildren(next);
            next = AddApplicantBenefits(next, b => b.None());
            next = AddPartnerBenefits(next, b => b.None());

            VerifyIneligible(next);
        }
        public void AgedOver25OnBenefits()
        {
            var next   = new StartBestStartGrant().Execute();
            var formId = next.Id;

            next = AddConsent(next);
            next = AddUKVerify(next);
            next = AddApplicantDetails(next, ad => ad.Over25(TestNowUtc.Value));
            next = AddExpectedChildren(next);
            next = AddExistingChildren(next);
            next = AddApplicantBenefits(next, b => b.WithBenefit());
            next = AddHealthProfessional(next);
            next = AddPaymentDetails(next);
            next = AddEvidence(next);
            next = AddDeclaration(next);

            VerifyComplete(next);
        }
        public void MultipleExistingChildren_OneNotKinshipCare()
        {
            var next   = new StartBestStartGrant().Execute();
            var formId = next.Id;

            next = AddConsent(next);
            next = AddUKVerify(next);
            next = AddApplicantDetails(next, ad => ad.Over25(TestNowUtc.Value));
            next = AddExpectedChildren(next, ec => ec.NoBabyExpected());
            next = AddExistingChildren(next, 3, ec => ec.LastNotKinshipCare());
            next = AddApplicantBenefits(next, b => b.WithBenefit());
            next = AddHealthProfessional(next);
            next = AddPaymentDetails(next);
            next = AddEvidence(next);
            next = AddDeclaration(next);

            VerifyComplete(next);
        }
        public void CareLeaverUnder25()
        {
            var next   = new StartBestStartGrant().Execute();
            var formId = next.Id;

            next = AddConsent(next);
            next = AddUKVerify(next);
            next = AddApplicantDetails(next, ad => ad.Under25CareLeaver(TestNowUtc.Value));
            next = AddExpectedChildren(next);
            next = AddExistingChildren(next);

            next.Section.Should().Be(Sections.HealthProfessional, "when under 25, and was previously in care, qualifying benefits are not required");

            next = AddHealthProfessional(next);
            next = AddPaymentDetails(next);
            next = AddEvidence(next);
            next = AddDeclaration(next);

            VerifyComplete(next);
        }
        public void MultipleExistingChildren_AllKinshipCare()
        {
            var next   = new StartBestStartGrant().Execute();
            var formId = next.Id;

            next = AddConsent(next);
            next = AddUKVerify(next);
            next = AddApplicantDetails(next, ad => ad.Over25(TestNowUtc.Value));
            next = AddExpectedChildren(next, ec => ec.NoBabyExpected());
            next = AddExistingChildren(next, 3, ec => ec.AllKinshipCare());

            next.Section.Should().Be(Sections.HealthProfessional, "where all existing children are kinship care, qualifying benefits are not required");

            next = AddHealthProfessional(next);
            next = AddPaymentDetails(next);
            next = AddEvidence(next);
            next = AddDeclaration(next);

            VerifyComplete(next);
        }
        public void Aged18PartOfGuardianBenefits_AllChildrenKinshipCare()
        {
            // 18, living with parents, and all children kinship care
            var next   = new StartBestStartGrant().Execute();
            var formId = next.Id;

            next = AddConsent(next);
            next = AddUKVerify(next);
            next = AddApplicantDetails(next, ad => ad.PartOfGuardianBenefits(TestNowUtc.Value));
            next = AddExpectedChildren(next, ec => ec.NoBabyExpected());
            next = AddExistingChildren(next, 3, ec => ec.AllKinshipCare());

            next.Section.Should().Be(Sections.HealthProfessional, "when all children kinship care, should skip all benefits");

            next = AddHealthProfessional(next);
            next = AddPaymentDetails(next);
            next = AddEvidence(next);
            next = AddDeclaration(next);

            VerifyComplete(next);
        }
        public void Aged16()
        {
            // 16/17 is automatically eligible, but no need gather legal parent/guardian details
            var next   = new StartBestStartGrant().Execute();
            var formId = next.Id;

            next = AddConsent(next);
            next = AddUKVerify(next);
            next = AddApplicantDetails(next, ad => ad.Aged16(TestNowUtc.Value));
            next = AddExpectedChildren(next);
            next = AddExistingChildren(next);

            next.Section.Should().Be(Sections.HealthProfessional, "under 16 should not be prompted for guardian details or applicant benefits");

            next = AddHealthProfessional(next);
            next = AddPaymentDetails(next);
            next = AddEvidence(next);
            next = AddDeclaration(next);

            VerifyComplete(next);
        }
        public void MultipleExistingChildren_AllKinshipCare_AtLeastOneBabyExpected()
        {
            var next   = new StartBestStartGrant().Execute();
            var formId = next.Id;

            next = AddConsent(next);
            next = AddUKVerify(next);
            next = AddApplicantDetails(next, ad => ad.Over25(TestNowUtc.Value));
            next = AddExpectedChildren(next, ec => ec.ExpectedBabyCount(1));
            next = AddExistingChildren(next, 3, ec => ec.AllKinshipCare());

            next.Section.Should().Be(Sections.ApplicantBenefits, "when there is an expected child, the expected child is not expected to be kinship care");

            next = AddApplicantBenefits(next, b => b.WithBenefit());
            next = AddHealthProfessional(next);
            next = AddPaymentDetails(next);
            next = AddEvidence(next);
            next = AddDeclaration(next);

            VerifyComplete(next);
        }