aboutsummaryrefslogtreecommitdiff
path: root/app/src/androidTest/kotlin/com/pitchedapps/frost/db/NotificationDbTest.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-03-07 17:28:32 -0500
committerAllan Wang <me@allanwang.ca>2019-03-07 17:28:32 -0500
commite617c95e2b4acfcfbeb1a72a658f19e69eaa3d6c (patch)
tree8a8171b7ab6f743051af7fd71bcd8ba538a486b8 /app/src/androidTest/kotlin/com/pitchedapps/frost/db/NotificationDbTest.kt
parent9e201159fd6697d83a16b7f7cfc5e7e302d55152 (diff)
downloadfrost-e617c95e2b4acfcfbeb1a72a658f19e69eaa3d6c.tar.gz
frost-e617c95e2b4acfcfbeb1a72a658f19e69eaa3d6c.tar.bz2
frost-e617c95e2b4acfcfbeb1a72a658f19e69eaa3d6c.zip
Rename some methods
Diffstat (limited to 'app/src/androidTest/kotlin/com/pitchedapps/frost/db/NotificationDbTest.kt')
-rw-r--r--app/src/androidTest/kotlin/com/pitchedapps/frost/db/NotificationDbTest.kt14
1 files changed, 7 insertions, 7 deletions
diff --git a/app/src/androidTest/kotlin/com/pitchedapps/frost/db/NotificationDbTest.kt b/app/src/androidTest/kotlin/com/pitchedapps/frost/db/NotificationDbTest.kt
index 176d0d3a..25c29db4 100644
--- a/app/src/androidTest/kotlin/com/pitchedapps/frost/db/NotificationDbTest.kt
+++ b/app/src/androidTest/kotlin/com/pitchedapps/frost/db/NotificationDbTest.kt
@@ -31,7 +31,7 @@ class NotificationDbTest : BaseDbTest() {
// Unique unsorted ids
val notifs = listOf(0L, 4L, 2L, 6L, 99L, 3L).map { notifContent(it, cookie) }
runBlocking {
- db.cookieDao().insertCookie(cookie)
+ db.cookieDao().save(cookie)
dao.saveNotifications(NOTIF_CHANNEL_GENERAL, notifs)
val dbNotifs = dao.selectNotifications(cookie.id, NOTIF_CHANNEL_GENERAL)
assertEquals(notifs.sortedByDescending { it.timestamp }, dbNotifs, "Incorrect notification list received")
@@ -45,8 +45,8 @@ class NotificationDbTest : BaseDbTest() {
val cookie2 = cookie(12L)
val notifs1 = (0L..2L).map { notifContent(it, cookie1) }
val notifs2 = (5L..10L).map { notifContent(it, cookie2) }
- db.cookieDao().insertCookie(cookie1)
- db.cookieDao().insertCookie(cookie2)
+ db.cookieDao().save(cookie1)
+ db.cookieDao().save(cookie2)
dao.saveNotifications(NOTIF_CHANNEL_GENERAL, notifs1)
dao.saveNotifications(NOTIF_CHANNEL_MESSAGES, notifs2)
assertEquals(
@@ -82,8 +82,8 @@ class NotificationDbTest : BaseDbTest() {
val cookie2 = cookie(12L)
val notifs1 = (0L..2L).map { notifContent(it, cookie1) }
val notifs2 = notifs1.map { it.copy(data = cookie2) }
- db.cookieDao().insertCookie(cookie1)
- db.cookieDao().insertCookie(cookie2)
+ db.cookieDao().save(cookie1)
+ db.cookieDao().save(cookie2)
assertTrue(dao.saveNotifications(NOTIF_CHANNEL_GENERAL, notifs1), "Notif1 save failed")
assertTrue(dao.saveNotifications(NOTIF_CHANNEL_GENERAL, notifs2), "Notif2 save failed")
}
@@ -95,7 +95,7 @@ class NotificationDbTest : BaseDbTest() {
// Unique unsorted ids
val notifs = listOf(0L, 4L, 2L, 6L, 99L, 3L).map { notifContent(it, cookie) }
runBlocking {
- db.cookieDao().insertCookie(cookie)
+ db.cookieDao().save(cookie)
dao.saveNotifications(NOTIF_CHANNEL_GENERAL, notifs)
db.cookieDao().deleteById(cookie.id)
val dbNotifs = dao.selectNotifications(cookie.id, NOTIF_CHANNEL_GENERAL)
@@ -110,7 +110,7 @@ class NotificationDbTest : BaseDbTest() {
val notifs = listOf(0L, 4L, 2L, 6L, 99L, 3L).map { notifContent(it, cookie) }
runBlocking {
assertEquals(-1L, dao.latestEpoch(cookie.id, NOTIF_CHANNEL_GENERAL), "Default epoch failed")
- db.cookieDao().insertCookie(cookie)
+ db.cookieDao().save(cookie)
dao.saveNotifications(NOTIF_CHANNEL_GENERAL, notifs)
assertEquals(99L, dao.latestEpoch(cookie.id, NOTIF_CHANNEL_GENERAL), "Latest epoch failed")
}