Preferences { public void setDownloadDate() { mPrefs.edit() .putLong(KEY_LAST_DOWNLOAD, new Date().getTime()) .remove(KEY_RESET_DB) .apply(); } @Inject  Preferences(Application app); long getLastDownloadDate(); void setDownloadDate(); Pair<String, String> getFavoriteCityLatLng(); void setFavoriteCity(City city); void reset(); void keepInMemory(City city); City getCity(); boolean isUsingHrMode(); void toggleMode(); boolean shouldResetData(); static final String PREFS_NAME; }
@Test public void should_remove_reset_database_flag_when_setting_a_download_date() { sharedPrefs.edit().putBoolean(KEY_RESET_DB, true).commit(); prefs.setDownloadDate(); assertThat(sharedPrefs.contains(KEY_RESET_DB)).isFalse(); }