@Test public void addPoiNameToTextViewTestSinglePoiInList() { List<OsmObject> poiList = new ArrayList<>(); poiList.add(new OsmObject(1, "node", "", "restaurant", 1, 1, 1)); PoiList.getInstance().setPoiList(poiList); when(preferences.getBooleanPreference(anyString())).thenReturn(true); questionsPresenter.addPoiNameToTextview(); verify(view).makeTextViewInvisible(); }
@Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestions.shuffleQuestions(); if (preferences.getBooleanPreference(PreferenceList.LOGGED_IN_TO_OSM)) { view.setViewPager(poiList.get(0), listOfQuestions); if (poiList.size() == 1) { view.makeTextViewInvisible(); } else { view.setTextviewText(poiList.get(0).getName()); } } else { view.startNewActivity(); } } }
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestions.shuffleQuestions(); if (preferences.getBooleanPreference(PreferenceList.LOGGED_IN_TO_OSM)) { view.setViewPager(poiList.get(0), listOfQuestions); if (poiList.size() == 1) { view.makeTextViewInvisible(); } else { view.setTextviewText(poiList.get(0).getName()); } } else { view.startNewActivity(); } } } }
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestions.shuffleQuestions(); if (preferences.getBooleanPreference(PreferenceList.LOGGED_IN_TO_OSM)) { view.setViewPager(poiList.get(0), listOfQuestions); if (poiList.size() == 1) { view.makeTextViewInvisible(); } else { view.setTextviewText(poiList.get(0).getName()); } } else { view.startNewActivity(); } } } QuestionsPresenter(QuestionsActivityContract.View view, SourceContract.Preferences preferences); }
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestions.shuffleQuestions(); if (preferences.getBooleanPreference(PreferenceList.LOGGED_IN_TO_OSM)) { view.setViewPager(poiList.get(0), listOfQuestions); if (poiList.size() == 1) { view.makeTextViewInvisible(); } else { view.setTextviewText(poiList.get(0).getName()); } } else { view.startNewActivity(); } } } QuestionsPresenter(QuestionsActivityContract.View view, SourceContract.Preferences preferences); @Override void addPoiNameToTextview(); @Override void assessIntentData(URI uri); @Override void savePoiList(); @Override void restorePoiList(); }
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestions.shuffleQuestions(); if (preferences.getBooleanPreference(PreferenceList.LOGGED_IN_TO_OSM)) { view.setViewPager(poiList.get(0), listOfQuestions); if (poiList.size() == 1) { view.makeTextViewInvisible(); } else { view.setTextviewText(poiList.get(0).getName()); } } else { view.startNewActivity(); } } } QuestionsPresenter(QuestionsActivityContract.View view, SourceContract.Preferences preferences); @Override void addPoiNameToTextview(); @Override void assessIntentData(URI uri); @Override void savePoiList(); @Override void restorePoiList();  }