package eu.friedcutlet.yokan.services.download import kotlin.test.Test import kotlin.test.assertFalse import kotlin.test.assertTrue class DownloadKeepAliveTest { @Test fun processStaysForegroundOnlyWhileDownloadsArePendingAndNotWaitingForWifi() { assertFalse(needsKeepAlive(DownloadQueueStatus()), "an empty or fully paused queue lets the service stop") assertTrue(needsKeepAlive(DownloadQueueStatus(pending = 1))) assertFalse( needsKeepAlive(DownloadQueueStatus(pending = 3, waitingForWifi = true)), "a queue waiting for Wi-Fi resumes through the network-constrained job instead", ) } }