SearchUserViewModel extends BaseObservable { public TextWatcher getUsernameTextWatcher() { return new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence charSequence, int start, int before, int count) { username = charSequence.toString(); } @Override public void afterTextChanged(Editable s) { } }; } @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 getUsernameTextWatcherShouldNotReturnNull() { TextWatcher usernameTextWatcher = searchUserViewModel.getUsernameTextWatcher(); assertNotNull(usernameTextWatcher); }