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

            var getApplicationDataResponse = await GetApplicationDataHandler.Handle(new GetApplicationDataRequest(ApplicationId), CancellationToken.None);

            var applicationData = JObject.Parse(getApplicationDataResponse.Value);
            var questionTag     = applicationData["Q1"];

            questionTag.Should().NotBeNull();
            questionTag.Value <string>().Should().BeNullOrEmpty();
        }
Example #2
0
        public async Task Then_questiontag_is_reset(string questionId, bool tagShouldExist)
        {
            await Handler.Handle(new ResetSectionAnswersRequest(ApplicationId, SequenceNo, SectionNo), CancellationToken.None);

            var getApplicationDataResponse = await GetApplicationDataHandler.Handle(new GetApplicationDataRequest(ApplicationId), CancellationToken.None);

            var applicationData = JObject.Parse(getApplicationDataResponse.Value);
            var questionTag     = applicationData[questionId];

            if (tagShouldExist)
            {
                // active tags should still exists
                questionTag.Should().NotBeNull();
                questionTag.Value <string>().Should().BeNullOrEmpty();
            }
            else
            {
                questionTag.Should().BeNull();
            }
        }