16 lines
696 B
Kotlin
16 lines
696 B
Kotlin
package studio.daybreak.mail
|
|
|
|
import org.junit.Assert.assertFalse
|
|
import org.junit.Assert.assertTrue
|
|
import org.junit.Test
|
|
|
|
class AndroidDownloadPolicyTest {
|
|
@Test
|
|
fun onlySelectsDownloadsCreatedByThisApplication() {
|
|
assertTrue(AndroidDownloadPolicy.isAppOwnedDownload("studio.daybreak.mail", "Download/", "studio.daybreak.mail"))
|
|
assertFalse(AndroidDownloadPolicy.isAppOwnedDownload("other.app", "Download/", "studio.daybreak.mail"))
|
|
assertFalse(AndroidDownloadPolicy.isAppOwnedDownload(null, "Download/", "studio.daybreak.mail"))
|
|
assertFalse(AndroidDownloadPolicy.isAppOwnedDownload("studio.daybreak.mail", "Documents/", "studio.daybreak.mail"))
|
|
}
|
|
}
|