add test for different number of days of cleanup

This commit is contained in:
Tom Hennen 2015-10-02 16:54:33 -04:00
parent 6f3d748aa0
commit 07bcdb167b
1 changed files with 15 additions and 0 deletions

View File

@ -307,4 +307,19 @@ public class PreferencesTest extends ActivityInstrumentationTestCase2<Preference
Timeout.getLargeTimeout())); Timeout.getLargeTimeout()));
} }
public void testEpisodeCleanupNumDays() {
solo.clickOnText(solo.getString(R.string.pref_episode_cleanup_title));
solo.waitForText(solo.getString(R.string.episode_cleanup_after_listening));
solo.clickOnText("5");
assertTrue(solo.waitForCondition(() -> {
EpisodeCleanupAlgorithm alg = UserPreferences.getEpisodeCleanupAlgorithm();
if (alg instanceof APCleanupAlgorithm) {
APCleanupAlgorithm cleanupAlg = (APCleanupAlgorithm)alg;
return cleanupAlg.getNumberOfDaysAfterPlayback() == 5;
}
return false;
},
Timeout.getLargeTimeout()));
}
} }