app/src/test/kotlin/com/honjimaku/subrep/MoreAppsTest.kt (970 bytes)
1 package com.honjimaku.subrep 2 3 import org.junit.Assert.assertEquals 4 import org.junit.Assert.assertFalse 5 import org.junit.Assert.assertTrue 6 import org.junit.Test 7 8 /** The list of the "More apps" section. */ 9 class MoreAppsTest { 10 11 @Test 12 fun theListLeavesOutThisApp() { 13 assertFalse(MORE_APPS.any { "equwal/subrep-android" in it.url }) 14 } 15 16 @Test 17 fun eachLinkOpensAnHttpsPage() { 18 for (app in MORE_APPS) assertTrue(app.url, app.url.startsWith("https://")) 19 } 20 21 @Test 22 fun theListKeepsTheOrderOfTheCatalog() { 23 assertEquals( 24 listOf("https://subread.space/", "https://booksimulator.com/", "https://honjimaku.com/", "https://sbmsync.com/"), 25 MORE_APPS.take(4).map { it.url }, 26 ) 27 assertEquals("https://recentlywritten.com/projects.html", MORE_APPS.last().url) 28 // The catalog has 15 entries. This app is the one that is not in the list. 29 assertEquals(14, MORE_APPS.size) 30 } 31 }