@Test(timeout = 1000) public void testRepositoryViewModelFetchesValidGitHubRepository() { RepositoryViewModel repositoryViewModel = new RepositoryViewModel( () -> Observable.just(new UserSettings(1)), repositoryId -> Observable.just(DataStreamNotification.onNext(testRepository))); repositoryViewModel.subscribeToDataStore(); repositoryViewModel.getRepository() .test() .awaitDone(100, TimeUnit.MILLISECONDS) .assertNoErrors() .assertValue(testRepository); }
@NonNull public Observable<GitHubRepository> getRepository() { return repository.hide(); }
RepositoryViewModel extends AbstractViewModel { @NonNull public Observable<GitHubRepository> getRepository() { return repository.hide(); } }
RepositoryViewModel extends AbstractViewModel { @NonNull public Observable<GitHubRepository> getRepository() { return repository.hide(); } RepositoryViewModel(@NonNull final GetUserSettings getUserSettings,
                               @NonNull final FetchAndGetGitHubRepository fetchAndGetGitHubRepository); }
RepositoryViewModel extends AbstractViewModel { @NonNull public Observable<GitHubRepository> getRepository() { return repository.hide(); } RepositoryViewModel(@NonNull final GetUserSettings getUserSettings,
                               @NonNull final FetchAndGetGitHubRepository fetchAndGetGitHubRepository); @Override void subscribeToDataStoreInternal(@NonNull final CompositeDisposable compositeDisposable); @NonNull Observable<GitHubRepository> getRepository(); }
RepositoryViewModel extends AbstractViewModel { @NonNull public Observable<GitHubRepository> getRepository() { return repository.hide(); } RepositoryViewModel(@NonNull final GetUserSettings getUserSettings,
                               @NonNull final FetchAndGetGitHubRepository fetchAndGetGitHubRepository); @Override void subscribeToDataStoreInternal(@NonNull final CompositeDisposable compositeDisposable); @NonNull Observable<GitHubRepository> getRepository();  }