@Test public void warning_whenServerAndAdminPasswordSet_isForBoth() { preferences.edit() .putString(KEY_PASSWORD, "blah") .putString(KEY_ADMIN_PW, "blah") .apply(); QRCodeViewModel viewModel = new QRCodeViewModel(qrCodeGenerator, preferences, preferences, fakeScheduler); fakeScheduler.runBackground(); assertThat(viewModel.getWarning().getValue(), is(R.string.qrcode_with_both_passwords)); }
public LiveData<Integer> getWarning() { return warning; }
QRCodeViewModel extends ViewModel { public LiveData<Integer> getWarning() { return warning; } }
QRCodeViewModel extends ViewModel { public LiveData<Integer> getWarning() { return warning; } QRCodeViewModel(QRCodeGenerator qrCodeGenerator, SharedPreferences generalSharedPreferences, SharedPreferences adminSharedPreferences, Scheduler scheduler); }
QRCodeViewModel extends ViewModel { public LiveData<Integer> getWarning() { return warning; } QRCodeViewModel(QRCodeGenerator qrCodeGenerator, SharedPreferences generalSharedPreferences, SharedPreferences adminSharedPreferences, Scheduler scheduler); LiveData<String> getFilePath(); LiveData<Bitmap> getBitmap(); LiveData<Integer> getWarning(); void setIncludedKeys(Collection<String> includedKeys); }
QRCodeViewModel extends ViewModel { public LiveData<Integer> getWarning() { return warning; } QRCodeViewModel(QRCodeGenerator qrCodeGenerator, SharedPreferences generalSharedPreferences, SharedPreferences adminSharedPreferences, Scheduler scheduler); LiveData<String> getFilePath(); LiveData<Bitmap> getBitmap(); LiveData<Integer> getWarning(); void setIncludedKeys(Collection<String> includedKeys);  }