use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.
the class AudioWidgetTest method setData_whenFileExists_callsValueChangeListener.
@Test
public void setData_whenFileExists_callsValueChangeListener() throws Exception {
AudioWidget widget = createWidget(promptWithAnswer(null));
WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
File newFile = questionMediaManager.addAnswerFile(File.createTempFile("blah", ".mp3"));
widget.setData(newFile);
verify(valueChangedListener).widgetValueChanged(widget);
}
use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.
the class BearingWidgetTest method setData_callsValueChangeListeners.
@Test
public void setData_callsValueChangeListeners() {
BearingWidget widget = createWidget(promptWithAnswer(null));
WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
widget.setData("blah");
verify(valueChangedListener).widgetValueChanged(widget);
}
use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.
the class GeoShapeWidgetTest method setData_callsValueChangeListener.
@Test
public void setData_callsValueChangeListener() {
GeoShapeWidget widget = createWidget(promptWithAnswer(null));
WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
widget.setData(answer);
verify(valueChangedListener).widgetValueChanged(widget);
}
use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.
the class QuestionWidgetHelpers method mockValueChangedListener.
public static <T extends QuestionWidget> WidgetValueChangedListener mockValueChangedListener(T widget) {
WidgetValueChangedListener valueChangedListener = mock(WidgetValueChangedListener.class);
widget.setValueChangedListener(valueChangedListener);
return valueChangedListener;
}
use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.
the class TimeWidgetTest method clearAnswer_callsValueChangeListener.
@Test
public void clearAnswer_callsValueChangeListener() {
TimeWidget widget = createWidget(promptWithQuestionDefAndAnswer(questionDef, new TimeData(timeAnswer.toDateTime().toDate())));
WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
widget.clearAnswer();
verify(valueChangedListener).widgetValueChanged(widget);
}
Aggregations