AllSharedPreferences { public String fetchLanguagePreference() { return preferences.getString(LANGUAGE_PREFERENCE_KEY, DEFAULT_LOCALE).trim(); } 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 shouldFetchLanguagePreference() throws Exception { when(preferences.getString(LANGUAGE_PREFERENCE_KEY, DEFAULT_LOCALE)).thenReturn(ENGLISH_LANGUAGE); assertEquals("English", allSharedPreferences.fetchLanguagePreference()); }