public void Declaration_POST_CompletesForm() { WebAppTest(client => { // the declaration form is now dependent on a completed ApplicantDetails, so... var detail = NewBsgDetail("form123"); ExecutorStub.SetupQuery(It.IsAny<FindBsgSection>(), detail); ExecutorStub.SetupCommand(It.IsAny<AddDeclaration>(), new NextSection { Type = NextType.Complete }); var response = client.Get(BsgActions.Declaration(detail.Id)).Form<Declaration>(1) .SelectConfirm(m => m.AgreedToLegalStatement, true) .Submit(client); ExecutorStub.Executed<AddDeclaration>(0).ShouldBeEquivalentTo(new AddDeclaration { FormId = "form123", Declaration = new Declaration { AgreedToLegalStatement = true, }, }); response.ActionResultOf<RedirectResult>().Url.Should().Be(BsgActions.Complete()); }); }
public void Complete_GET() { WebAppTest(client => { var response = client.Get(BsgActions.Complete()); response.Text.ToLower().Should().Contain("received"); }); }
public void NextSection_RedirectToComplete() { WebAppTest(client => { ExecutorStub.SetupCommand(It.IsAny <AddApplicantDetails>(), new NextSection { Type = NextType.Complete }); var response = client.Get(BsgActions.ApplicantDetails("form123")).Form <ApplicantDetails>(1).Submit(client); response.ActionResultOf <RedirectResult>().Url.Should().Be(BsgActions.Complete()); }); }