diff options
author | mueller-ma <mueller-ma@users.noreply.github.com> | 2023-04-15 21:08:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-15 21:08:03 +0200 |
commit | 0bdf9d9e28572bba38fd36ad518e817dbdd04fe5 (patch) | |
tree | 5711d01accb4b0d42815d2a6c51277e51aaca6ff /app/src/androidTest/java | |
parent | 8396a346707677ce22373a96e905bb1763d5cfb9 (diff) | |
download | AntennaPod-0bdf9d9e28572bba38fd36ad518e817dbdd04fe5.zip |
Add option to enable sleep timer based on current time (#6384)
Diffstat (limited to 'app/src/androidTest/java')
-rw-r--r-- | app/src/androidTest/java/de/test/antennapod/service/playback/SleepTimerPreferencesTest.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/service/playback/SleepTimerPreferencesTest.java b/app/src/androidTest/java/de/test/antennapod/service/playback/SleepTimerPreferencesTest.java new file mode 100644 index 000000000..4339d6cd7 --- /dev/null +++ b/app/src/androidTest/java/de/test/antennapod/service/playback/SleepTimerPreferencesTest.java @@ -0,0 +1,22 @@ +package de.test.antennapod.service.playback; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +import de.danoeh.antennapod.core.preferences.SleepTimerPreferences; + +public class SleepTimerPreferencesTest { + @Test + public void testIsInTimeRange() { + assertTrue(SleepTimerPreferences.isInTimeRange(0, 10, 8)); + assertTrue(SleepTimerPreferences.isInTimeRange(1, 10, 8)); + assertTrue(SleepTimerPreferences.isInTimeRange(1, 10, 1)); + assertTrue(SleepTimerPreferences.isInTimeRange(20, 10, 8)); + assertTrue(SleepTimerPreferences.isInTimeRange(20, 20, 8)); + assertFalse(SleepTimerPreferences.isInTimeRange(1, 6, 8)); + assertFalse(SleepTimerPreferences.isInTimeRange(1, 6, 6)); + assertFalse(SleepTimerPreferences.isInTimeRange(20, 6, 8)); + } +} |