diff options
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)); + } +} |