SelectionCardPresenter implements SelectableTextView.OnWordSelectedListener { public void onSearchClicked() { contextHelper.searchWeb(getTextInFocus()); controller.onButtonClicked(); } @Inject  SelectionCardPresenter(SelectionCardController controller, ContextHelper contextHelper); @Override void onWordSelected(String word); void onClipTextChanged(@NonNull String clipText); void addView(SelectionCardView selectionCardView); void removeView(); void onDefineClicked(); void onSearchClicked(); void onCopyClicked(); void onWikiClicked(); void onShareClicked(); void onSettingsClicked(); static boolean isLessThanNWords(String text, int n);  }
@Test public void testOnSearchClicked() throws Exception { String clipText = "The whole cliptext"; String selected = "cliptext"; presenter.onClipTextChanged(clipText); presenter.onSearchClicked(); verifySearchClicked(clipText); resetAllMocks(); presenter.onWordSelected(selected); presenter.onSearchClicked(); verifySearchClicked(selected); resetAllMocks(); presenter.onClipTextChanged(clipText); presenter.onSearchClicked(); verifySearchClicked(clipText); }