Yokan / rebuild
Course 1 8624561

DownloadKeepAliveTest.kt

composeApp/src/commonTest/kotlin/eu/friedcutlet/yokan/services/download/DownloadKeepAliveTest.kt

test / fixture17 lines
1package eu.friedcutlet.yokan.services.download23import kotlin.test.Test4import kotlin.test.assertFalse5import kotlin.test.assertTrue67class DownloadKeepAliveTest {8    @Test9    fun processStaysForegroundOnlyWhileDownloadsArePendingAndNotWaitingForWifi() {10        assertFalse(needsKeepAlive(DownloadQueueStatus()), "an empty or fully paused queue lets the service stop")11        assertTrue(needsKeepAlive(DownloadQueueStatus(pending = 1)))12        assertFalse(13            needsKeepAlive(DownloadQueueStatus(pending = 3, waitingForWifi = true)),14            "a queue waiting for Wi-Fi resumes through the network-constrained job instead",15        )16    }17}18

Search chapters, reference and source filenames.