use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.
the class RatingWidgetTest method changingRating_callsValueChangeListeners_forRatingBarInMultipleLines.
@Test
public void changingRating_callsValueChangeListeners_forRatingBarInMultipleLines() {
when(rangeQuestion.getRangeEnd()).thenReturn(BigDecimal.valueOf(10));
RatingWidget widget = createWidget(promptWithQuestionAndAnswer(rangeQuestion, null));
WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
widget.setValueChangedListener(valueChangedListener);
widget.binding.ratingBar2.setRating(4.0F);
verify(valueChangedListener, atLeastOnce()).widgetValueChanged(widget);
}
use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.
the class GeoPointMapWidgetTest method setData_callsValueChangeListener.
@Test
public void setData_callsValueChangeListener() {
GeoPointMapWidget widget = createWidget(promptWithAnswer(null));
WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
widget.setData(answer.getDisplayText());
verify(valueChangedListener).widgetValueChanged(widget);
}
use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.
the class GeoPointMapWidgetTest method clearAnswer_callsValueChangeListeners.
@Test
public void clearAnswer_callsValueChangeListeners() {
GeoPointMapWidget 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 GeoShapeWidgetTest method clearAnswer_callsValueChangeListeners.
@Test
public void clearAnswer_callsValueChangeListeners() {
GeoShapeWidget 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 DateWidgetTest method clearAnswer_callsValueChangeListener.
@Test
public void clearAnswer_callsValueChangeListener() {
DateWidget widget = createWidget(promptWithQuestionDefAndAnswer(questionDef, new DateData(dateAnswer.toDate())));
WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
widget.clearAnswer();
verify(valueChangedListener).widgetValueChanged(widget);
}
Aggregations