Add subtitles on right, hold OK for channel number, selectable picture (0.29.0)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
package tv.orbit.classic
|
||||
|
||||
import org.junit.Assert.*
|
||||
import org.junit.Test
|
||||
|
||||
class WatchingControlsTest {
|
||||
@Test
|
||||
fun theNumberBoxStartsOnTheCurrentChannel() {
|
||||
assertEquals(listOf(1, 0, 3), ChannelEntry.from(103).digits)
|
||||
assertEquals(listOf(0, 0, 7), ChannelEntry.from(7).digits)
|
||||
assertEquals(103, ChannelEntry.from(103).number)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dialingWrapsWithinTheChosenDigit() {
|
||||
val entry = ChannelEntry.from(103).next().next()
|
||||
assertEquals(104, entry.dial(1).number)
|
||||
assertEquals(102, entry.dial(-1).number)
|
||||
assertEquals(100, ChannelEntry.from(109).next().next().dial(1).number)
|
||||
assertEquals(903, ChannelEntry.from(103).dial(8).number)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun movingBetweenDigitsStopsAtTheEnds() {
|
||||
val entry = ChannelEntry.from(103)
|
||||
assertEquals(0, entry.previous().slot)
|
||||
assertEquals(2, entry.next().next().next().slot)
|
||||
assertTrue(entry.next().next().onLastSlot)
|
||||
assertFalse(entry.onLastSlot)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun typedDigitsFillInOrder() {
|
||||
val typed = ChannelEntry.from(101).type(2).type(5).type(9)
|
||||
assertEquals(259, typed.number)
|
||||
assertEquals(2, typed.slot)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun subtitlesStepThroughTracksThenOff() {
|
||||
assertEquals(0, nextSubtitle(null, 2))
|
||||
assertEquals(1, nextSubtitle(0, 2))
|
||||
assertNull(nextSubtitle(1, 2))
|
||||
assertNull(nextSubtitle(null, 0))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun subtitlesKeepTheirLanguageAcrossProgrammes() {
|
||||
assertEquals(1, subtitleFor("eng", listOf("fre", "eng")))
|
||||
assertEquals(0, subtitleFor("eng", listOf("fre", "spa")))
|
||||
assertNull(subtitleFor(null, listOf("eng")))
|
||||
assertNull(subtitleFor("eng", emptyList()))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user