Search in sources :

Example 6 with WidgetValueChangedListener

use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.

the class DateTimeWidgetTest method clearAnswer_callValueChangeListener.

@Test
public void clearAnswer_callValueChangeListener() {
    DateTimeWidget widget = createWidget(promptWithQuestionDefAndAnswer(questionDef, new DateTimeData(localDateTime.toDate())));
    WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
    widget.clearAnswer();
    verify(valueChangedListener).widgetValueChanged(widget);
}
Also used : DateTimeData(org.javarosa.core.model.data.DateTimeData) WidgetValueChangedListener(org.odk.collect.android.listeners.WidgetValueChangedListener) Test(org.junit.Test)

Example 7 with WidgetValueChangedListener

use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.

the class GeoPointWidgetTest method setData_callsValueChangeListener.

@Test
public void setData_callsValueChangeListener() {
    GeoPointWidget widget = createWidget(promptWithAnswer(null));
    WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
    widget.setData(answer.getDisplayText());
    verify(valueChangedListener).widgetValueChanged(widget);
}
Also used : WidgetValueChangedListener(org.odk.collect.android.listeners.WidgetValueChangedListener) Test(org.junit.Test)

Example 8 with WidgetValueChangedListener

use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.

the class GeoPointWidgetTest method clearAnswer_callsValueChangeListeners.

@Test
public void clearAnswer_callsValueChangeListeners() {
    GeoPointWidget widget = createWidget(promptWithAnswer(null));
    WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
    widget.clearAnswer();
    verify(valueChangedListener).widgetValueChanged(widget);
}
Also used : WidgetValueChangedListener(org.odk.collect.android.listeners.WidgetValueChangedListener) Test(org.junit.Test)

Example 9 with WidgetValueChangedListener

use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.

the class TriggerWidgetTest method checkingCheckbox_callsValueChangeListeners.

@Test
public void checkingCheckbox_callsValueChangeListeners() {
    TriggerWidget widget = createWidget(promptWithAnswer(null));
    WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
    CheckBox triggerButton = widget.getCheckBox();
    triggerButton.setChecked(true);
    verify(valueChangedListener).widgetValueChanged(widget);
}
Also used : CheckBox(android.widget.CheckBox) WidgetValueChangedListener(org.odk.collect.android.listeners.WidgetValueChangedListener) Test(org.junit.Test)

Example 10 with WidgetValueChangedListener

use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.

the class GeoTraceWidgetTest method setData_callsValueChangeListener.

@Test
public void setData_callsValueChangeListener() {
    GeoTraceWidget widget = createWidget(promptWithAnswer(null));
    WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
    widget.setData(answer);
    verify(valueChangedListener).widgetValueChanged(widget);
}
Also used : WidgetValueChangedListener(org.odk.collect.android.listeners.WidgetValueChangedListener) Test(org.junit.Test)

Aggregations

WidgetValueChangedListener (org.odk.collect.android.listeners.WidgetValueChangedListener)35 Test (org.junit.Test)34 StringData (org.javarosa.core.model.data.StringData)6 File (java.io.File)2 Selection (org.javarosa.core.model.data.helper.Selection)2 CheckBox (android.widget.CheckBox)1 Arrays.asList (java.util.Arrays.asList)1 List (java.util.List)1 DateData (org.javarosa.core.model.data.DateData)1 DateTimeData (org.javarosa.core.model.data.DateTimeData)1 SelectMultiData (org.javarosa.core.model.data.SelectMultiData)1 SelectOneData (org.javarosa.core.model.data.SelectOneData)1 TimeData (org.javarosa.core.model.data.TimeData)1 QuestionWidget (org.odk.collect.android.widgets.QuestionWidget)1 GeneralSelectMultiWidgetTest (org.odk.collect.android.widgets.base.GeneralSelectMultiWidgetTest)1 GeneralSelectOneWidgetTest (org.odk.collect.android.widgets.base.GeneralSelectOneWidgetTest)1