mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 07:29:14 +01:00
open now playing when the media notification is tapped
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package com.subtracks.ui
|
||||
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class NowPlayingRequestTest {
|
||||
@Test
|
||||
fun aNotificationWithNothingPlayingDoesNotOpen() {
|
||||
assertFalse(shouldOpenNowPlaying(request = 1, handled = 0, playerVisible = false))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aNotificationWithSomethingPlayingOpens() {
|
||||
assertTrue(shouldOpenNowPlaying(request = 1, handled = 0, playerVisible = true))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun anAlreadyHandledRequestDoesNotReopen() {
|
||||
assertFalse(shouldOpenNowPlaying(request = 1, handled = 1, playerVisible = true))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aNewerRequestOpensAgain() {
|
||||
assertTrue(shouldOpenNowPlaying(request = 2, handled = 1, playerVisible = true))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun anOldRequestWaitsUntilSomethingIsPlaying() {
|
||||
assertFalse(shouldOpenNowPlaying(request = 1, handled = 0, playerVisible = false))
|
||||
assertTrue(shouldOpenNowPlaying(request = 1, handled = 0, playerVisible = true))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user