use of org.mifos.platform.questionnaire.service.SectionDetail in project head by mifos.
the class SectionDetailFormTest method getSectionDefinition.
private SectionDetail getSectionDefinition() {
SectionDetail sectionDetail = new SectionDetail();
sectionDetail.addQuestion(new SectionQuestionDetail(new QuestionDetail(121, "Question1", QuestionType.FREETEXT, true, true), true));
sectionDetail.addQuestion(new SectionQuestionDetail(new QuestionDetail(122, "Question2", QuestionType.FREETEXT, true, true), false));
sectionDetail.addQuestion(new SectionQuestionDetail(new QuestionDetail(123, "Question3", QuestionType.FREETEXT, true, true), true));
return sectionDetail;
}
use of org.mifos.platform.questionnaire.service.SectionDetail in project head by mifos.
the class QuestionGroupFormTest method shouldGetEventSourceId.
@Test
public void shouldGetEventSourceId() {
EventSourceDto eventSourceDto = new EventSourceDto("Create", "Client", "Create Client");
QuestionGroupDetail questionGroupDetail = new QuestionGroupDetail(123, "Title", Arrays.asList(eventSourceDto), new ArrayList<SectionDetail>(), false);
QuestionGroupForm questionGroupForm = new QuestionGroupForm(questionGroupDetail);
assertThat(questionGroupForm.getEventSourceIds().get(0), is("Create.Client"));
}
use of org.mifos.platform.questionnaire.service.SectionDetail in project head by mifos.
the class QuestionGroupFormTest method shouldGetSections.
@Test
public void shouldGetSections() {
SectionDetail sectionDetail = new SectionDetail();
sectionDetail.setName("Section1");
QuestionGroupDetail questionGroupDetail = new QuestionGroupDetail(123, "Title", null, asList(sectionDetail), false);
QuestionGroupForm questionGroupForm = new QuestionGroupForm(questionGroupDetail);
List<SectionDetailForm> sections = questionGroupForm.getSections();
assertThat(questionGroupForm.getInitialCountOfSections(), is(1));
assertThat(sections, notNullValue());
assertThat(sections.size(), is(1));
assertThat(sections.get(0).getName(), is("Section1"));
assertThat(sections.get(0).getInitialCountOfQuestions(), is(0));
}
use of org.mifos.platform.questionnaire.service.SectionDetail in project head by mifos.
the class QuestionGroupControllerTest method getQuestionGroupDetail.
private QuestionGroupDetail getQuestionGroupDetail(int questionGroupId, String title, String... sectionNames) {
List<SectionDetail> sectionDetails = new ArrayList<SectionDetail>();
for (String sectionName : sectionNames) {
SectionDetail sectionDetail = new SectionDetail();
sectionDetail.setName(sectionName);
sectionDetails.add(sectionDetail);
}
return new QuestionGroupDetail(questionGroupId, title, sectionDetails);
}
use of org.mifos.platform.questionnaire.service.SectionDetail in project head by mifos.
the class QuestionnaireMapperIntegrationTest method getSectionDefinitions.
private List<SectionDetail> getSectionDefinitions() {
List<SectionDetail> sectionDetails = new ArrayList<SectionDetail>();
SectionDetail sectionDetail = new SectionDetail();
sectionDetail.setName("Name");
sectionDetails.add(sectionDetail);
return sectionDetails;
}
Aggregations