use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.
the class RangeIntegerWidgetTest method clearAnswer_callsValueChangeListener.
@Test
public void clearAnswer_callsValueChangeListener() {
RangeIntegerWidget widget = createWidget(promptWithQuestionDefAndAnswer(rangeQuestion, null));
WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
widget.clearAnswer();
verify(valueChangedListener).widgetValueChanged(widget);
}
use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.
the class RangePickerIntegerWidgetTest method clearAnswer_callsValueChangeListener.
@Test
public void clearAnswer_callsValueChangeListener() {
RangePickerIntegerWidget widget = createWidget(promptWithQuestionDefAndAnswer(rangeQuestion, null));
WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
widget.clearAnswer();
verify(valueChangedListener).widgetValueChanged(widget);
}
use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.
the class SelectMultiMinimalWidgetTest method whenAnswerChanges_shouldValueChangeListenersBeCalled.
@Test
public void whenAnswerChanges_shouldValueChangeListenersBeCalled() {
WidgetValueChangedListener valueChangedListener = mockValueChangedListener(getSpyWidget());
SelectMultiData answer = getInitialAnswer();
Selection selectedChoice = ((List<Selection>) answer.getValue()).get(0);
getSpyWidget().setData(Collections.singletonList(selectedChoice));
verify(valueChangedListener).widgetValueChanged(getSpyWidget());
}
use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.
the class OSMWidgetTest method clearAnswer_callsValueChangeListeners.
@Test
public void clearAnswer_callsValueChangeListeners() {
OSMWidget widget = createWidget(promptWithAnswer(new StringData("blah")));
WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
widget.clearAnswer();
verify(valueChangedListener).widgetValueChanged(widget);
}
use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.
the class OSMWidgetTest method setData_callsValueChangeListeners.
@Test
public void setData_callsValueChangeListeners() {
OSMWidget widget = createWidget(promptWithAnswer(null));
WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
widget.setData("blah");
verify(valueChangedListener).widgetValueChanged(widget);
}
Aggregations