diff options
author | Allan Wang <me@allanwang.ca> | 2019-03-05 20:03:55 -0500 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-03-05 20:03:55 -0500 |
commit | 5c4400975450c9739f0986561075983e08afae89 (patch) | |
tree | 65d81d67a0971cdb8dc8107a515fff0c82088940 /app/src/androidTest/kotlin/com/pitchedapps | |
parent | cd0e7549d4a9876923649b83bbc82dab9caa0232 (diff) | |
download | frost-5c4400975450c9739f0986561075983e08afae89.tar.gz frost-5c4400975450c9739f0986561075983e08afae89.tar.bz2 frost-5c4400975450c9739f0986561075983e08afae89.zip |
Add fb tab test
Diffstat (limited to 'app/src/androidTest/kotlin/com/pitchedapps')
-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 |