@Test public void testGetGreeting_doesNotEmit_whenNoLanguageSet() { TestSubscriber<String> testSubscriber = new TestSubscriber<>(); mMainViewModel.getObservableGreeting().subscribe(testSubscriber); testSubscriber.assertNoErrors(); testSubscriber.assertNoValues(); }
@NonNull public Observable<String> getObservableGreeting() { return mObservableSelectedLanguage .observeOn(mSchedulerProvider.computation()) .map(Language::getCode) .flatMap(mDataModel::getObservableGreetingByLanguageCode); }
MainViewModel { @NonNull public Observable<String> getObservableGreeting() { return mObservableSelectedLanguage .observeOn(mSchedulerProvider.computation()) .map(Language::getCode) .flatMap(mDataModel::getObservableGreetingByLanguageCode); } }
MainViewModel { @NonNull public Observable<String> getObservableGreeting() { return mObservableSelectedLanguage .observeOn(mSchedulerProvider.computation()) .map(Language::getCode) .flatMap(mDataModel::getObservableGreetingByLanguageCode); } MainViewModel(@NonNull final IDataModel dataModel,
                         @NonNull final ISchedulerProvider schedulerProvider); }
MainViewModel { @NonNull public Observable<String> getObservableGreeting() { return mObservableSelectedLanguage .observeOn(mSchedulerProvider.computation()) .map(Language::getCode) .flatMap(mDataModel::getObservableGreetingByLanguageCode); } MainViewModel(@NonNull final IDataModel dataModel,
                         @NonNull final ISchedulerProvider schedulerProvider); @NonNull Observable<String> getObservableGreeting(); @NonNull Observable<List<Language>> getObservableSupportedLanguages(); void emitlanguageSelected(@NonNull final Language language); int getValue(@NonNull int xxx); }
MainViewModel { @NonNull public Observable<String> getObservableGreeting() { return mObservableSelectedLanguage .observeOn(mSchedulerProvider.computation()) .map(Language::getCode) .flatMap(mDataModel::getObservableGreetingByLanguageCode); } MainViewModel(@NonNull final IDataModel dataModel,
                         @NonNull final ISchedulerProvider schedulerProvider); @NonNull Observable<String> getObservableGreeting(); @NonNull Observable<List<Language>> getObservableSupportedLanguages(); void emitlanguageSelected(@NonNull final Language language); int getValue(@NonNull int xxx);  }