use of org.odk.collect.android.listeners.WidgetValueChangedListener in project collect by opendatakit.
the class AudioWidgetTest method clearAnswer_callsValueChangeListeners.
@Test
public void clearAnswer_callsValueChangeListeners() throws Exception {
File answerFile = questionMediaManager.addAnswerFile(File.createTempFile("blah", ".mp3"));
AudioWidget widget = createWidget(promptWithAnswer(new StringData(answerFile.getName())));
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 BearingWidgetTest method clearAnswer_callsValueChangeListeners.
@Test
public void clearAnswer_callsValueChangeListeners() {
BearingWidget 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 QuestionWidgetTest method callingClearShouldCallValueChangeListeners.
@Test
public void callingClearShouldCallValueChangeListeners() {
when(formEntryPrompt.getAnswerText()).thenReturn(getInitialAnswer().getDisplayText());
QuestionWidget widget = (QuestionWidget) getSpyWidget();
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 BarcodeWidgetTest method setData_callsValueChangeListener.
@Test
public void setData_callsValueChangeListener() {
BarcodeWidget 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 BarcodeWidgetTest method clearAnswer_callsValueChangeListener.
@Test
public void clearAnswer_callsValueChangeListener() {
BarcodeWidget widget = createWidget(promptWithAnswer(new StringData("blah")));
WidgetValueChangedListener valueChangedListener = mockValueChangedListener(widget);
widget.clearAnswer();
verify(valueChangedListener).widgetValueChanged(widget);
}
Aggregations