use of org.odk.collect.android.widgets.ItemsetWidgetTest in project collect by opendatakit.
the class QuestionWidgetTest method getAnswerShouldReturnExistingAnswerIfPromptHasExistingAnswer.
@Test
public void getAnswerShouldReturnExistingAnswerIfPromptHasExistingAnswer() {
A answer = getInitialAnswer();
if (answer instanceof StringData && !(this instanceof ItemsetWidgetTest)) {
when(formEntryPrompt.getAnswerText()).thenReturn((String) answer.getValue());
} else {
when(formEntryPrompt.getAnswerValue()).thenReturn(answer);
}
W widget = getWidget();
IAnswerData newAnswer = widget.getAnswer();
assertNotNull(newAnswer);
assertEquals(newAnswer.getDisplayText(), answer.getDisplayText());
}
Aggregations