예제 #1
0
        public void Find_PopulatesExistingDetail_IfCurrentDetailDoesNotExist()
        {
            var existingForm = new ChangeOfCircsBuilder("form123")
                               .WithCompletedSections(excludeOptionalSections: true)
                               .Insert();

            var query = new FindCocSection
            {
                FormId  = "form123",
                Section = Sections.Consent,
            };

            var details = query.Find();

            var expectedDetail = new CocDetail {
                PreviousSection = null
            };

            ChangeOfCircsBuilder.CopySectionsFrom(existingForm, expectedDetail, useExisting: true);

            details.ShouldBeEquivalentTo(expectedDetail);
        }
예제 #2
0
        public void Find_PopulatesDetail()
        {
            var existingForm = new ChangeOfCircsBuilder("form123")
                               .WithCompletedSections(markAsCompleted: false)
                               .Insert();

            var query = new FindCocSection
            {
                FormId  = "form123",
                Section = Sections.Consent,
            };

            var detail = query.Find();

            var expectedDetail = new CocDetail {
                PreviousSection = null
            };

            ChangeOfCircsBuilder.CopySectionsFrom(existingForm, expectedDetail);

            detail.ShouldBeEquivalentTo(expectedDetail);
        }