use of org.javarosa.form.api.FormEntryPrompt in project collect by opendatakit.
the class WidgetFactoryTest method testCreatingSelectOneMinimalWidget.
@Test
public void testCreatingSelectOneMinimalWidget() {
FormEntryPrompt prompt = new MockFormEntryPromptBuilder().withControlType(Constants.CONTROL_SELECT_ONE).withAppearance("something miNimal something").build();
QuestionWidget widget = widgetFactory.createWidgetFromPrompt(prompt, null);
assertThat(widget, instanceOf(SelectOneMinimalWidget.class));
}
use of org.javarosa.form.api.FormEntryPrompt in project collect by opendatakit.
the class WidgetFactoryTest method testCreatingSelectOneListWidget.
@Test
public void testCreatingSelectOneListWidget() {
FormEntryPrompt prompt = new MockFormEntryPromptBuilder().withControlType(Constants.CONTROL_SELECT_ONE).withAppearance("something LisT something").build();
QuestionWidget widget = widgetFactory.createWidgetFromPrompt(prompt, null);
assertThat(widget, instanceOf(ListWidget.class));
assertThat(((ListWidget) widget).shouldDisplayLabel(), is(true));
}
use of org.javarosa.form.api.FormEntryPrompt in project collect by opendatakit.
the class WidgetFactoryTest method testCreatingSelectMultipleOneLabelWidget.
@Test
public void testCreatingSelectMultipleOneLabelWidget() {
FormEntryPrompt prompt = new MockFormEntryPromptBuilder().withControlType(Constants.CONTROL_SELECT_MULTI).withAppearance("something lAbeL something").build();
QuestionWidget widget = widgetFactory.createWidgetFromPrompt(prompt, null);
assertThat(widget, instanceOf(LabelWidget.class));
}
use of org.javarosa.form.api.FormEntryPrompt in project collect by opendatakit.
the class WidgetFactoryTest method testCreatingSelectMultipleListWidget.
@Test
public void testCreatingSelectMultipleListWidget() {
FormEntryPrompt prompt = new MockFormEntryPromptBuilder().withControlType(Constants.CONTROL_SELECT_MULTI).withAppearance("something LisT something").build();
QuestionWidget widget = widgetFactory.createWidgetFromPrompt(prompt, null);
assertThat(widget, instanceOf(ListMultiWidget.class));
assertThat(((ListMultiWidget) widget).shouldDisplayLabel(), is(true));
}
use of org.javarosa.form.api.FormEntryPrompt in project collect by opendatakit.
the class WidgetFactoryTest method testCreatingLikertWidget.
@Test
public void testCreatingLikertWidget() {
FormEntryPrompt prompt = new MockFormEntryPromptBuilder().withControlType(Constants.CONTROL_SELECT_ONE).withAppearance("something lIkErt something").build();
QuestionWidget widget = widgetFactory.createWidgetFromPrompt(prompt, null);
assertThat(widget, instanceOf(LikertWidget.class));
}
Aggregations