diff options
author | ByteHamster <info@bytehamster.com> | 2022-04-25 22:45:47 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2022-04-26 17:57:42 +0200 |
commit | 069a2ca329a342ad0559a48719f49264d2610f00 (patch) | |
tree | 59cc8327dec62ddfd105d1ad2fdb59dcba12736e /app/src/androidTest | |
parent | 20363ee41c814b14b16999505fa850a0943346dd (diff) | |
download | AntennaPod-069a2ca329a342ad0559a48719f49264d2610f00.zip |
Decouple preferences
Diffstat (limited to 'app/src/androidTest')
-rw-r--r-- | app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java b/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java index 902cad98c..ef5719d6f 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java @@ -10,6 +10,7 @@ import androidx.test.espresso.matcher.RootMatchers; import androidx.test.filters.LargeTest; import androidx.test.rule.ActivityTestRule; +import de.danoeh.antennapod.core.storage.EpisodeCleanupAlgorithmFactory; import org.awaitility.Awaitility; import org.junit.Before; import org.junit.Rule; @@ -397,7 +398,7 @@ public class PreferencesTest { onView(withId(R.id.select_dialog_listview)).perform(swipeDown()); onView(withText(R.string.episode_cleanup_except_favorite_removal)).perform(click()); Awaitility.await().atMost(1000, MILLISECONDS) - .until(() -> UserPreferences.getEpisodeCleanupAlgorithm() instanceof ExceptFavoriteCleanupAlgorithm); + .until(() -> EpisodeCleanupAlgorithmFactory.build() instanceof ExceptFavoriteCleanupAlgorithm); } @Test @@ -408,7 +409,7 @@ public class PreferencesTest { onView(withId(R.id.select_dialog_listview)).perform(swipeDown()); onView(withText(R.string.episode_cleanup_queue_removal)).perform(click()); Awaitility.await().atMost(1000, MILLISECONDS) - .until(() -> UserPreferences.getEpisodeCleanupAlgorithm() instanceof APQueueCleanupAlgorithm); + .until(() -> EpisodeCleanupAlgorithmFactory.build() instanceof APQueueCleanupAlgorithm); } @Test @@ -419,7 +420,7 @@ public class PreferencesTest { onView(withId(R.id.select_dialog_listview)).perform(swipeUp()); onView(withText(R.string.episode_cleanup_never)).perform(click()); Awaitility.await().atMost(1000, MILLISECONDS) - .until(() -> UserPreferences.getEpisodeCleanupAlgorithm() instanceof APNullCleanupAlgorithm); + .until(() -> EpisodeCleanupAlgorithmFactory.build() instanceof APNullCleanupAlgorithm); } @Test @@ -431,7 +432,7 @@ public class PreferencesTest { onView(withText(R.string.episode_cleanup_after_listening)).perform(click()); Awaitility.await().atMost(1000, MILLISECONDS) .until(() -> { - EpisodeCleanupAlgorithm alg = UserPreferences.getEpisodeCleanupAlgorithm(); + EpisodeCleanupAlgorithm alg = EpisodeCleanupAlgorithmFactory.build(); if (alg instanceof APCleanupAlgorithm) { APCleanupAlgorithm cleanupAlg = (APCleanupAlgorithm) alg; return cleanupAlg.getNumberOfHoursAfterPlayback() == 0; @@ -450,7 +451,7 @@ public class PreferencesTest { onView(withText(search)).perform(click()); Awaitility.await().atMost(1000, MILLISECONDS) .until(() -> { - EpisodeCleanupAlgorithm alg = UserPreferences.getEpisodeCleanupAlgorithm(); + EpisodeCleanupAlgorithm alg = EpisodeCleanupAlgorithmFactory.build(); if (alg instanceof APCleanupAlgorithm) { APCleanupAlgorithm cleanupAlg = (APCleanupAlgorithm) alg; return cleanupAlg.getNumberOfHoursAfterPlayback() == 72; // 5 days |