diff options
Diffstat (limited to 'app/src/androidTest')
-rw-r--r-- | app/src/androidTest/kotlin/com/pitchedapps/frost/db/FbTabsDbTest.kt | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/app/src/androidTest/kotlin/com/pitchedapps/frost/db/FbTabsDbTest.kt b/app/src/androidTest/kotlin/com/pitchedapps/frost/db/FbTabsDbTest.kt new file mode 100644 index 00000000..a2dce692 --- /dev/null +++ b/app/src/androidTest/kotlin/com/pitchedapps/frost/db/FbTabsDbTest.kt @@ -0,0 +1,32 @@ +package com.pitchedapps.frost.db + +import com.pitchedapps.frost.facebook.FbItem +import com.pitchedapps.frost.facebook.defaultTabs +import kotlinx.coroutines.runBlocking +import kotlin.test.Test +import kotlin.test.assertEquals + +class FbTabsDbTest : BaseDbTest() { + + /** + * Note that order is also preserved here + */ + @Test + fun save() { + val tabs = listOf(FbItem.ACTIVITY_LOG, FbItem.BIRTHDAYS, FbItem.EVENTS, FbItem.MARKETPLACE, FbItem.ACTIVITY_LOG) + runBlocking { + db.tabDao().save(tabs) + assertEquals(tabs, db.tabDao().selectAll(), "Tab saving failed") + val newTabs = listOf(FbItem.PAGES, FbItem.MENU) + db.tabDao().save(newTabs) + assertEquals(newTabs, db.tabDao().selectAll(), "Tab saving does not delete preexisting items") + } + } + + @Test + fun defaultRetrieve() { + runBlocking { + assertEquals(defaultTabs(), db.tabDao().selectAll(), "Default retrieval failed") + } + } +}
\ No newline at end of file |