Search in sources :

Example 21 with MockFormEntryPromptBuilder

use of org.odk.collect.android.support.MockFormEntryPromptBuilder in project collect by opendatakit.

the class WidgetFactoryTest method testCreatingSelectOneImageMapWidget.

@Test
public void testCreatingSelectOneImageMapWidget() {
    FormEntryPrompt prompt = new MockFormEntryPromptBuilder().withControlType(Constants.CONTROL_SELECT_ONE).withAppearance("something imaGe-Map something").build();
    QuestionWidget widget = widgetFactory.createWidgetFromPrompt(prompt, null);
    assertThat(widget, instanceOf(SelectOneImageMapWidget.class));
}
Also used : FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) MockFormEntryPromptBuilder(org.odk.collect.android.support.MockFormEntryPromptBuilder) SelectOneImageMapWidget(org.odk.collect.android.widgets.items.SelectOneImageMapWidget) Test(org.junit.Test)

Example 22 with MockFormEntryPromptBuilder

use of org.odk.collect.android.support.MockFormEntryPromptBuilder in project collect by opendatakit.

the class WidgetFactoryTest method testCreatingSelectMultipleImageMapWidget.

@Test
public void testCreatingSelectMultipleImageMapWidget() {
    FormEntryPrompt prompt = new MockFormEntryPromptBuilder().withControlType(Constants.CONTROL_SELECT_MULTI).withAppearance("something imaGe-Map something").build();
    QuestionWidget widget = widgetFactory.createWidgetFromPrompt(prompt, null);
    assertThat(widget, instanceOf(SelectMultiImageMapWidget.class));
}
Also used : FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) SelectMultiImageMapWidget(org.odk.collect.android.widgets.items.SelectMultiImageMapWidget) MockFormEntryPromptBuilder(org.odk.collect.android.support.MockFormEntryPromptBuilder) Test(org.junit.Test)

Example 23 with MockFormEntryPromptBuilder

use of org.odk.collect.android.support.MockFormEntryPromptBuilder 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));
}
Also used : FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) SelectOneMinimalWidget(org.odk.collect.android.widgets.items.SelectOneMinimalWidget) MockFormEntryPromptBuilder(org.odk.collect.android.support.MockFormEntryPromptBuilder) Test(org.junit.Test)

Example 24 with MockFormEntryPromptBuilder

use of org.odk.collect.android.support.MockFormEntryPromptBuilder 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));
}
Also used : FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) ListWidget(org.odk.collect.android.widgets.items.ListWidget) MockFormEntryPromptBuilder(org.odk.collect.android.support.MockFormEntryPromptBuilder) Test(org.junit.Test)

Example 25 with MockFormEntryPromptBuilder

use of org.odk.collect.android.support.MockFormEntryPromptBuilder 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));
}
Also used : FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) LabelWidget(org.odk.collect.android.widgets.items.LabelWidget) MockFormEntryPromptBuilder(org.odk.collect.android.support.MockFormEntryPromptBuilder) Test(org.junit.Test)

Aggregations

MockFormEntryPromptBuilder (org.odk.collect.android.support.MockFormEntryPromptBuilder)138 Test (org.junit.Test)130 FormEntryPrompt (org.javarosa.form.api.FormEntryPrompt)90 SelectChoice (org.javarosa.core.model.SelectChoice)42 Clip (org.odk.collect.audioclips.Clip)24 RandomString (net.bytebuddy.utility.RandomString)18 FileWidgetTest (org.odk.collect.android.widgets.base.FileWidgetTest)18 ImageView (android.widget.ImageView)16 AppDependencyModule (org.odk.collect.android.injection.config.AppDependencyModule)16 SynchronousImageLoader (org.odk.collect.android.widgets.support.SynchronousImageLoader)16 ImageLoader (org.odk.collect.imageloader.ImageLoader)16 BitmapDrawable (android.graphics.drawable.BitmapDrawable)14 Drawable (android.graphics.drawable.Drawable)14 GeneralSelectOneWidgetTest (org.odk.collect.android.widgets.base.GeneralSelectOneWidgetTest)14 Pair (androidx.core.util.Pair)12 TextView (android.widget.TextView)10 GeneralSelectMultiWidgetTest (org.odk.collect.android.widgets.base.GeneralSelectMultiWidgetTest)10 File (java.io.File)8 ReferenceManager (org.javarosa.core.reference.ReferenceManager)8 CollectHelpers.setupFakeReferenceManager (org.odk.collect.android.support.CollectHelpers.setupFakeReferenceManager)8