SearchUserViewModel extends BaseObservable { public void onClickSearch(View view) { loadUsers(); } @Inject  SearchUserViewModel(@Named("searchUser") UseCase searchUserUseCase); void setFragmentListener(FragmentListener fragmentListener); TextWatcher getUsernameTextWatcher(); boolean onSearchAction(TextView view, int actionId, KeyEvent event); void onClickSearch(View view); void destroy(Boolean unsubsricbe); void setUsername(String username); ObservableInt getProgressVisibility(); ObservableInt getUserListVisibility(); final ObservableInt progressVisibility; final ObservableInt userListVisibility; }
@Test public void onClickSearchShouldDisplayMessageWhenNoUsernameInput() { searchUserViewModel.onClickSearch(view); verify(fragmentListener).showMessage("Enter a username"); }