AllSharedPreferences { public Boolean fetchIsSyncInProgress() { return preferences.getBoolean(IS_SYNC_IN_PROGRESS_PREFERENCE_KEY, false); } AllSharedPreferences(SharedPreferences preferences); void updateANMUserName(String userName); String fetchRegisteredANM(); String fetchLanguagePreference(); void saveLanguagePreference(String languagePreference); Boolean fetchIsSyncInProgress(); void saveIsSyncInProgress(Boolean isSyncInProgress); static final String ANM_IDENTIFIER_PREFERENCE_KEY; }
@Test public void shouldFetchIsSyncInProgress() throws Exception { when(preferences.getBoolean(IS_SYNC_IN_PROGRESS_PREFERENCE_KEY, false)).thenReturn(true); assertTrue(allSharedPreferences.fetchIsSyncInProgress()); }