Search in sources :

Example 81 with FormEntryPrompt

use of org.javarosa.form.api.FormEntryPrompt in project collect by opendatakit.

the class GeoPointWidgetTest method buttonClick_requestsGeoPoint_whenAnswerIsCleared.

@Test
public void buttonClick_requestsGeoPoint_whenAnswerIsCleared() {
    FormEntryPrompt prompt = promptWithAnswer(answer);
    GeoPointWidget widget = createWidget(prompt);
    widget.clearAnswer();
    widget.binding.simpleButton.performClick();
    verify(geoDataRequester).requestGeoPoint(prompt, null, waitingForDataRegistry);
}
Also used : FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) Test(org.junit.Test)

Example 82 with FormEntryPrompt

use of org.javarosa.form.api.FormEntryPrompt in project collect by opendatakit.

the class GeoPointWidgetTest method buttonClick_requestsGeoPoint.

@Test
public void buttonClick_requestsGeoPoint() {
    FormEntryPrompt prompt = promptWithAnswer(answer);
    GeoPointWidget widget = createWidget(prompt);
    widget.binding.simpleButton.performClick();
    verify(geoDataRequester).requestGeoPoint(prompt, answer.getDisplayText(), waitingForDataRegistry);
}
Also used : FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) Test(org.junit.Test)

Example 83 with FormEntryPrompt

use of org.javarosa.form.api.FormEntryPrompt in project collect by opendatakit.

the class GeoPointMapWidgetTest method buttonClick_requestsGeoPoint_whenAnswerIsUpdated.

@Test
public void buttonClick_requestsGeoPoint_whenAnswerIsUpdated() {
    FormEntryPrompt prompt = promptWithAnswer(null);
    GeoPointMapWidget widget = createWidget(prompt);
    widget.setData(answer);
    widget.binding.simpleButton.performClick();
    verify(geoDataRequester).requestGeoPoint(prompt, answer.getDisplayText(), waitingForDataRegistry);
}
Also used : FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) Test(org.junit.Test)

Example 84 with FormEntryPrompt

use of org.javarosa.form.api.FormEntryPrompt in project collect by opendatakit.

the class GeoPointMapWidgetTest method buttonClick_requestsGeoPoint_whenAnswerIsCleared.

@Test
public void buttonClick_requestsGeoPoint_whenAnswerIsCleared() {
    FormEntryPrompt prompt = promptWithAnswer(answer);
    GeoPointMapWidget widget = createWidget(prompt);
    widget.clearAnswer();
    widget.binding.simpleButton.performClick();
    verify(geoDataRequester).requestGeoPoint(prompt, null, waitingForDataRegistry);
}
Also used : FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) Test(org.junit.Test)

Example 85 with FormEntryPrompt

use of org.javarosa.form.api.FormEntryPrompt in project collect by opendatakit.

the class GeoShapeWidgetTest method buttonClick_requestsGeoShape_whenAnswerIsUpdated.

@Test
public void buttonClick_requestsGeoShape_whenAnswerIsUpdated() {
    FormEntryPrompt prompt = promptWithAnswer(null);
    GeoShapeWidget widget = createWidget(prompt);
    widget.setData(answer);
    widget.binding.simpleButton.performClick();
    verify(geoDataRequester).requestGeoShape(prompt, answer, waitingForDataRegistry);
}
Also used : FormEntryPrompt(org.javarosa.form.api.FormEntryPrompt) Test(org.junit.Test)

Aggregations

FormEntryPrompt (org.javarosa.form.api.FormEntryPrompt)114 Test (org.junit.Test)92 MockFormEntryPromptBuilder (org.odk.collect.android.support.MockFormEntryPromptBuilder)45 Clip (org.odk.collect.audioclips.Clip)13 FormIndex (org.javarosa.core.model.FormIndex)10 File (java.io.File)9 SelectChoice (org.javarosa.core.model.SelectChoice)7 StringData (org.javarosa.core.model.data.StringData)7 IFormElement (org.javarosa.core.model.IFormElement)5 QuestionDef (org.javarosa.core.model.QuestionDef)5 FormController (org.odk.collect.android.javarosawrapper.FormController)5 GroupDef (org.javarosa.core.model.GroupDef)4 QuestionDetails (org.odk.collect.android.formentry.questions.QuestionDetails)4 DatePickerDetails (org.odk.collect.android.logic.DatePickerDetails)4 ArrayList (java.util.ArrayList)3 DateData (org.javarosa.core.model.data.DateData)3 IAnswerData (org.javarosa.core.model.data.IAnswerData)3 TreeReference (org.javarosa.core.model.instance.TreeReference)3 LocalDateTime (org.joda.time.LocalDateTime)3 AudioControllerView (org.odk.collect.android.audio.AudioControllerView)3