Preferences { public long getLastDownloadDate() { return mPrefs.getLong(KEY_LAST_DOWNLOAD, 0L); } @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_return_0_as_last_download_date_at_first_launch_if_none() { sharedPrefs.edit().remove(KEY_LAST_DOWNLOAD).commit(); long lastDownloadDate = prefs.getLastDownloadDate(); assertThat(lastDownloadDate).isEqualTo(0L); }