@Test public void getAnswer_whenPromptAnswerDoesNotHaveConvertibleString_returnsNull() { GeoPointWidget widget = createWidget(promptWithAnswer(new StringData("blah"))); assertThat(widget.getAnswer(), equalTo(null)); assertThat(widget.binding.geoAnswerText.getText(), equalTo("")); }
@Override public IAnswerData getAnswer() { if (stringAnswer == null || stringAnswer.isEmpty()) { return null; } else { return new GeoPointData(GeoWidgetUtils.getLocationParamsFromStringAnswer(stringAnswer)); } }
GeoPointWidget extends QuestionWidget implements BinaryDataReceiver { @Override public IAnswerData getAnswer() { if (stringAnswer == null || stringAnswer.isEmpty()) { return null; } else { return new GeoPointData(GeoWidgetUtils.getLocationParamsFromStringAnswer(stringAnswer)); } } }
GeoPointWidget extends QuestionWidget implements BinaryDataReceiver { @Override public IAnswerData getAnswer() { if (stringAnswer == null || stringAnswer.isEmpty()) { return null; } else { return new GeoPointData(GeoWidgetUtils.getLocationParamsFromStringAnswer(stringAnswer)); } } GeoPointWidget(Context context, QuestionDetails questionDetails, QuestionDef questionDef, WaitingForDataRegistry waitingForDataRegistry); }
GeoPointWidget extends QuestionWidget implements BinaryDataReceiver { @Override public IAnswerData getAnswer() { if (stringAnswer == null || stringAnswer.isEmpty()) { return null; } else { return new GeoPointData(GeoWidgetUtils.getLocationParamsFromStringAnswer(stringAnswer)); } } GeoPointWidget(Context context, QuestionDetails questionDetails, QuestionDef questionDef, WaitingForDataRegistry waitingForDataRegistry); @Override IAnswerData getAnswer(); @Override void clearAnswer(); @Override void setOnLongClickListener(OnLongClickListener l); @Override void cancelLongPress(); @Override void setBinaryData(Object answer); }
GeoPointWidget extends QuestionWidget implements BinaryDataReceiver { @Override public IAnswerData getAnswer() { if (stringAnswer == null || stringAnswer.isEmpty()) { return null; } else { return new GeoPointData(GeoWidgetUtils.getLocationParamsFromStringAnswer(stringAnswer)); } } GeoPointWidget(Context context, QuestionDetails questionDetails, QuestionDef questionDef, WaitingForDataRegistry waitingForDataRegistry); @Override IAnswerData getAnswer(); @Override void clearAnswer(); @Override void setOnLongClickListener(OnLongClickListener l); @Override void cancelLongPress(); @Override void setBinaryData(Object answer);  }