public void BeforeYouApply_GET() { WebAppTest(client => { var response = client.Get(BsgActions.BeforeYouApply()); response.Text.ToLower().Should().Contain("before you apply"); }); }
public void IncludingGuardianDetails() { App.GoTo(BsgActions.BeforeYouApply()); App.VerifyCanSeeText("Before You Apply"); App.Submit(); FillInConsent(); App.Submit(); App.VerifyCanSeeText("confirm who you are"); App.Submit(); var dob = DateTime.Now.Date.AddYears(-18); FillInApplicantDetails(dob, previouslyLookedAfter: false, fullTimeEducation: true); App.Submit(); var expectancyDate = DateTime.UtcNow.Date.AddDays(100); FillInExpectedChildren(expectancyDate); App.Submit(); App.VerifyCanSeeText("in the household"); FillInNoExistingChildren(); App.ClickButton(""); App.VerifyCanSeeText("guardian's benefits"); FillInGuardianBenefits(); App.Submit(); App.VerifyCanSeeText("guardian's partner's benefits"); FillInGuardianPartnerBenefits(); App.Submit(); var guardianDob = DateTime.Now.Date.AddYears(-39); FillInGuardianDetails(guardianDob); App.Submit(); var guardianPartnerDob = DateTime.Now.Date.AddYears(-38); FillInGuardianPartnerDetails(guardianPartnerDob); App.Submit(); Db(r => { var doc = r.Query <BestStartGrant>().ToList().Single(); VerifyGuardianBenefits(doc); VerifyGuardianPartnerBenefits(doc); VerifyGuardianDetails(doc, guardianDob); VerifyGuardianPartnerDetails(doc, guardianPartnerDob); }); }
public void BeforeYouApply_POST_StartsForm() { WebAppTest(client => { ExecutorStub.SetupCommand(It.IsAny <StartBestStartGrant>(), new NextSection { Id = "form123", Section = Sections.Consent, }); var response = client.Get(BsgActions.BeforeYouApply()).Form <object>(1) .Submit(client); ExecutorStub.Executed <StartBestStartGrant>().Length.Should().Be(1); response.ActionResultOf <RedirectResult>().Url.Should().NotBeNullOrWhiteSpace(); }); }
public void CompleteApplication() { App.GoTo(BsgActions.BeforeYouApply()); App.VerifyCanSeeText("Before You Apply"); App.Submit(); FillInConsent(); App.Submit(); App.VerifyCanSeeText("confirm who you are"); App.Submit(); var dob = DateTime.Now.Date.AddYears(-19); FillInApplicantDetails(dob, previouslyLookedAfter: false, fullTimeEducation: false); App.Submit(); var expectancyDate = DateTime.UtcNow.Date.AddDays(100); FillInExpectedChildren(expectancyDate); App.Submit(); FillInExistingChildren(); App.ClickButton(""); FillInApplicantBenefits(); App.Submit(); App.VerifyCanSeeText("partner's benefits"); FillInPartnerBenefits(); App.Submit(); var partnerDob = DateTime.Now.Date.AddYears(-21); FillInPartnerDetails(partnerDob); App.Submit(); FillInHealthProfessional(); App.Submit(); FillInPaymentDetails(); App.Submit(); var filename = FillInEvidence(); App.ClickButton(""); FillInDeclaration(); App.Submit(); App.VerifyCanSeeText("Thank you"); Db(r => { var doc = r.Query <BestStartGrant>().ToList().Single(); VerifyConsent(doc); VerifyUKVerify(doc); VerifyApplicantDetails(doc, dob, false, false); VerifyExpectedChildren(doc, expectancyDate); VerifyExistingChildren(doc); VerifyApplicantBenefits(doc); VerifyPartnerBenefits(doc); VerifyPartnerDetails(doc, partnerDob); VerifyHealthProfessional(doc); VerifyPaymentDetails(doc); VerifyEvidence(doc, filename); VerifyDeclaration(doc); }); }