private NextSection AddEvidence(NextSection current, Action <Evidence> mutator = null)
 {
     current.Section.Should().Be(Sections.Evidence);
     return(NextSection(current.Section, () => new AddEvidence {
         FormId = current.Id, Evidence = EvidenceBuilder.NewValid(mutator)
     }.Execute()));
 }
 private NextSection AddDeclaration(NextSection current, Action <Declaration> mutator = null)
 {
     current.Section.Should().Be(Sections.Declaration);
     return(NextSection(current.Section, () => new AddDeclaration {
         FormId = current.Id, Declaration = DeclarationBuilder.NewValid(mutator)
     }.Execute()));
 }
 private NextSection AddHealthProfessional(NextSection current, Action <HealthProfessional> mutator = null)
 {
     current.Section.Should().Be(Sections.HealthProfessional);
     return(NextSection(current.Section, () => new AddHealthProfessional {
         FormId = current.Id, HealthProfessional = HealthProfessionalBuilder.NewValid(mutator)
     }.Execute()));
 }
 private NextSection AddPaymentDetails(NextSection current, Action <PaymentDetails> mutator = null)
 {
     current.Section.Should().Be(Sections.PaymentDetails);
     return(NextSection(current.Section, () => new AddPaymentDetails {
         FormId = current.Id, PaymentDetails = PaymentDetailsBuilder.NewValid(mutator)
     }.Execute()));
 }
 private NextSection AddGuardianPartnerBenefits(NextSection current, Action <Benefits> mutator = null)
 {
     current.Section.Should().Be(Sections.GuardianPartnerBenefits);
     return(NextSection(current.Section, () => new AddGuardianPartnerBenefits {
         FormId = current.Id, GuardianPartnerBenefits = BenefitsBuilder.NewWithBenefit(mutator)
     }.Execute()));
 }
 private NextSection AddGuardianPartnerDetails(NextSection current, Action <RelationDetails> mutator = null)
 {
     current.Section.Should().Be(Sections.GuardianPartnerDetails);
     return(NextSection(current.Section, () => new AddGuardianPartnerDetails {
         FormId = current.Id, GuardianPartnerDetails = RelationDetailsBuilder.NewValid(mutator)
     }.Execute()));
 }
 private NextSection AddUKVerify(NextSection current, Action <UKVerify> mutator = null)
 {
     current.Section.Should().Be(Sections.UKVerify);
     return(NextSection(current.Section, () => new AddUKVerify {
         FormId = current.Id
     }.Execute()));
 }
 private NextSection AddExistingChildren(NextSection current, int childCount = 2, Action <ExistingChildren> mutator = null)
 {
     current.Section.Should().Be(Sections.ExistingChildren);
     return(NextSection(current.Section, () => new AddExistingChildren {
         FormId = current.Id, ExistingChildren = ExistingChildrenBuilder.NewValid(childCount, mutator)
     }.Execute()));
 }
 private NextSection AddConsent(NextSection current, Action <Consent> mutator = null)
 {
     current.Section.Should().Be(Sections.Consent);
     return(NextSection(current.Section, () => new AddConsent {
         FormId = current.Id, Consent = ConsentBuilder.NewValid(mutator)
     }.Execute()));
 }
Ejemplo n.º 10
0
 private NextSection AddOptions(NextSection current, Action <Options> mutator = null)
 {
     current.Section.Should().Be(Sections.Options);
     return(NextSection(current.Section, () => new AddOptions {
         FormId = current.Id, Options = OptionsBuilder.NewValid(mutator)
     }.Execute()));
 }
Ejemplo n.º 11
0
 private NextSection AddIdentity(NextSection current, string userId)
 {
     current.Section.Should().Be(Sections.Identity);
     return(NextSection(current.Section, () => new AddIdentity {
         FormId = current.Id, Identity = userId
     }.Execute()));
 }
Ejemplo n.º 12
0
        private void VerifyIneligible(NextSection next)
        {
            next.Type.Should().Be(NextType.Ineligible);
            next.Section.Should().BeNull();
            var form = Repository.Load <BestStartGrant>(next.Id);

            form.Completed.Should().BeNull("ineligible should not 'complete' the form");
            _gotToEnd = true;
        }
Ejemplo n.º 13
0
        private RedirectResult RedirectNext(NextSection next)
        {
            if (!next.Section.HasValue)
            {
                return(Redirect(CocActions.Complete()));
            }

            var action = SectionActionStrategy.For(next.Section.Value).Action(next.Id);

            return(Redirect(action));
        }
Ejemplo n.º 14
0
        private RedirectResult RedirectNext(NextSection next)
        {
            if (next.Type == NextType.Complete)
            {
                return(Redirect(BsgActions.Complete()));
            }

            if (next.Type == NextType.Ineligible)
            {
                return(Redirect(BsgActions.Ineligible(next.Id)));
            }

            var action = SectionActionStrategy.For(next.Section.Value).Action(next.Id);

            return(Redirect(action));
        }
Ejemplo n.º 15
0
 private void VerifyComplete(NextSection next)
 {
     next.Type.Should().Be(NextType.Complete);
     next.Section.Should().BeNull();
     _gotToEnd = true;
 }