public async Task Then_page_answers_are_reset()
        {
            await Handler.Handle(new ResetPageAnswersRequest(ApplicationId, SectionId, "1"), CancellationToken.None);

            var getPageResponse = await GetPageHandler.Handle(new GetPageRequest(ApplicationId, SectionId, "1"), CancellationToken.None);

            getPageResponse.Value.PageOfAnswers.Should().BeEmpty();
        }
        public async Task Then_page_complete_is_false()
        {
            await Handler.Handle(new ResetPageAnswersRequest(ApplicationId, SectionId, "1"), CancellationToken.None);

            var getPageResponse = await GetPageHandler.Handle(new GetPageRequest(ApplicationId, SectionId, "1"), CancellationToken.None);

            getPageResponse.Value.Complete.Should().BeFalse();
        }
Exemplo n.º 3
0
        public async Task Then_pages_has_active_status_set_correctly(string pageId, bool active)
        {
            await Handler.Handle(new ResetSectionAnswersRequest(ApplicationId, SequenceNo, SectionNo), CancellationToken.None);

            var pageResponse = await GetPageHandler.Handle(new GetPageRequest(ApplicationId, SectionId, pageId), CancellationToken.None);

            pageResponse.Value.Active.Should().Be(active);
        }
        public async Task Then_all_pages_have_their_active_status_set_correctly()
        {
            await Handler.Handle(new ResetPageAnswersRequest(ApplicationId, SectionId, "1"), CancellationToken.None);

            var page1Response = await GetPageHandler.Handle(new GetPageRequest(ApplicationId, SectionId, "1"), CancellationToken.None);

            page1Response.Value.Active.Should().BeTrue();

            var page2Response = await GetPageHandler.Handle(new GetPageRequest(ApplicationId, SectionId, "2"), CancellationToken.None);

            page2Response.Value.Active.Should().BeFalse();

            var page3Response = await GetPageHandler.Handle(new GetPageRequest(ApplicationId, SectionId, "3"), CancellationToken.None);

            page3Response.Value.Active.Should().BeFalse();
        }