use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.
the class GeoTraceWidgetTest method clearAnswer_callsValueChangeListeners.
@Test
public void clearAnswer_callsValueChangeListeners() {
GeoTraceWidget widget = createWidget(promptWithAnswer(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 RangeIntegerWidgetTest method changingSliderValueProgramatically_doesNotCallValueChangeListener.
@Test
public void changingSliderValueProgramatically_doesNotCallValueChangeListener() {
RangeIntegerWidget widget = createWidget(promptWithQuestionDefAndAnswer(rangeQuestion, null));
WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
widget.slider.setValue(4);
verify(valueChangedListener, never()).widgetValueChanged(widget);
}
use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.
the class RangeIntegerWidgetTest method changingSliderValue_callsValueChangeListener.
@Test
public void changingSliderValue_callsValueChangeListener() {
RangeIntegerWidget widget = createWidget(promptWithQuestionDefAndAnswer(rangeQuestion, null));
WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
widget.slider.onTouchEvent(motionEvent);
verify(valueChangedListener).widgetValueChanged(widget);
}
use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.
the class RangeDecimalWidgetTest method changingSliderValueProgramatically_doesNotCallValueChangeListener.
@Test
public void changingSliderValueProgramatically_doesNotCallValueChangeListener() {
RangeDecimalWidget widget = createWidget(promptWithQuestionDefAndAnswer(rangeQuestion, null));
WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
widget.slider.setValue(2.5F);
verify(valueChangedListener, never()).widgetValueChanged(widget);
}
use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.
the class RatingWidgetTest method clearAnswer_callsValueChangeListeners.
@Test
public void clearAnswer_callsValueChangeListeners() {
RatingWidget widget = createWidget(promptWithQuestionAndAnswer(rangeQuestion, new StringData("3")));
WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
widget.setValueChangedListener(valueChangedListener);
widget.clearAnswer();
verify(valueChangedListener, atLeastOnce()).widgetValueChanged(widget);
}
Aggregations