rename mock* to fake*
This commit is contained in:
parent
9882c27bf6
commit
7186d2e651
|
@ -3,8 +3,8 @@ package com.keylesspalace.tusky.components.notifications
|
|||
import androidx.paging.PagingSource
|
||||
import androidx.room.withTransaction
|
||||
import com.keylesspalace.tusky.components.timeline.Placeholder
|
||||
import com.keylesspalace.tusky.components.timeline.mockAccount
|
||||
import com.keylesspalace.tusky.components.timeline.mockStatus
|
||||
import com.keylesspalace.tusky.components.timeline.fakeAccount
|
||||
import com.keylesspalace.tusky.components.timeline.fakeStatus
|
||||
import com.keylesspalace.tusky.components.timeline.toEntity
|
||||
import com.keylesspalace.tusky.db.AppDatabase
|
||||
import com.keylesspalace.tusky.db.entity.NotificationDataEntity
|
||||
|
@ -16,11 +16,11 @@ import com.keylesspalace.tusky.entity.TimelineAccount
|
|||
import java.util.Date
|
||||
import org.junit.Assert.assertEquals
|
||||
|
||||
fun mockNotification(
|
||||
fun fakeNotification(
|
||||
type: Notification.Type = Notification.Type.FAVOURITE,
|
||||
id: String = "1",
|
||||
account: TimelineAccount = mockAccount(id = id),
|
||||
status: Status? = mockStatus(id = id),
|
||||
account: TimelineAccount = fakeAccount(id = id),
|
||||
status: Status? = fakeStatus(id = id),
|
||||
report: Report? = null
|
||||
) = Notification(
|
||||
type = type,
|
||||
|
@ -30,12 +30,12 @@ fun mockNotification(
|
|||
report = report
|
||||
)
|
||||
|
||||
fun mockReport(
|
||||
fun fakeReport(
|
||||
id: String = "1",
|
||||
category: String = "spam",
|
||||
statusIds: List<String>? = null,
|
||||
createdAt: Date = Date(1712509983273),
|
||||
targetAccount: TimelineAccount = mockAccount()
|
||||
targetAccount: TimelineAccount = fakeAccount()
|
||||
) = Report(
|
||||
id = id,
|
||||
category = category,
|
|
@ -124,7 +124,7 @@ class NotificationsRemoteMediatorTest {
|
|||
listOf(
|
||||
PagingSource.LoadResult.Page(
|
||||
data = listOf(
|
||||
mockNotification(id = "3").toNotificationDataEntity(1)
|
||||
fakeNotification(id = "3").toNotificationDataEntity(1)
|
||||
),
|
||||
prevKey = null,
|
||||
nextKey = 1
|
||||
|
@ -142,9 +142,9 @@ class NotificationsRemoteMediatorTest {
|
|||
@ExperimentalPagingApi
|
||||
fun `should refresh and insert placeholder when a whole page with no overlap to existing notifications is loaded`() = runTest {
|
||||
val notificationsAlreadyInDb = listOf(
|
||||
mockNotification(id = "3"),
|
||||
mockNotification(id = "2"),
|
||||
mockNotification(id = "1")
|
||||
fakeNotification(id = "3"),
|
||||
fakeNotification(id = "2"),
|
||||
fakeNotification(id = "1")
|
||||
)
|
||||
|
||||
db.insert(notificationsAlreadyInDb)
|
||||
|
@ -154,16 +154,16 @@ class NotificationsRemoteMediatorTest {
|
|||
api = mock {
|
||||
onBlocking { notifications(limit = 3, excludes = emptySet()) } doReturn Response.success(
|
||||
listOf(
|
||||
mockNotification(id = "8"),
|
||||
mockNotification(id = "7"),
|
||||
mockNotification(id = "5")
|
||||
fakeNotification(id = "8"),
|
||||
fakeNotification(id = "7"),
|
||||
fakeNotification(id = "5")
|
||||
)
|
||||
)
|
||||
onBlocking { notifications(maxId = "3", limit = 3, excludes = emptySet()) } doReturn Response.success(
|
||||
listOf(
|
||||
mockNotification(id = "3"),
|
||||
mockNotification(id = "2"),
|
||||
mockNotification(id = "1")
|
||||
fakeNotification(id = "3"),
|
||||
fakeNotification(id = "2"),
|
||||
fakeNotification(id = "1")
|
||||
)
|
||||
)
|
||||
},
|
||||
|
@ -189,12 +189,12 @@ class NotificationsRemoteMediatorTest {
|
|||
|
||||
db.assertNotifications(
|
||||
listOf(
|
||||
mockNotification(id = "8").toNotificationDataEntity(1),
|
||||
mockNotification(id = "7").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "8").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "7").toNotificationDataEntity(1),
|
||||
Placeholder(id = "5", loading = false).toNotificationDataEntity(1),
|
||||
mockNotification(id = "3").toNotificationDataEntity(1),
|
||||
mockNotification(id = "2").toNotificationDataEntity(1),
|
||||
mockNotification(id = "1").toNotificationDataEntity(1)
|
||||
fakeNotification(id = "3").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "2").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "1").toNotificationDataEntity(1)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -203,9 +203,9 @@ class NotificationsRemoteMediatorTest {
|
|||
@ExperimentalPagingApi
|
||||
fun `should refresh and not insert placeholder when less than a whole page is loaded`() = runTest {
|
||||
val notificationsAlreadyInDb = listOf(
|
||||
mockNotification(id = "3"),
|
||||
mockNotification(id = "2"),
|
||||
mockNotification(id = "1")
|
||||
fakeNotification(id = "3"),
|
||||
fakeNotification(id = "2"),
|
||||
fakeNotification(id = "1")
|
||||
)
|
||||
|
||||
db.insert(notificationsAlreadyInDb)
|
||||
|
@ -215,16 +215,16 @@ class NotificationsRemoteMediatorTest {
|
|||
api = mock {
|
||||
onBlocking { notifications(limit = 20, excludes = emptySet()) } doReturn Response.success(
|
||||
listOf(
|
||||
mockNotification(id = "8"),
|
||||
mockNotification(id = "7"),
|
||||
mockNotification(id = "5")
|
||||
fakeNotification(id = "8"),
|
||||
fakeNotification(id = "7"),
|
||||
fakeNotification(id = "5")
|
||||
)
|
||||
)
|
||||
onBlocking { notifications(maxId = "3", limit = 20, excludes = emptySet()) } doReturn Response.success(
|
||||
listOf(
|
||||
mockNotification(id = "3"),
|
||||
mockNotification(id = "2"),
|
||||
mockNotification(id = "1")
|
||||
fakeNotification(id = "3"),
|
||||
fakeNotification(id = "2"),
|
||||
fakeNotification(id = "1")
|
||||
)
|
||||
)
|
||||
},
|
||||
|
@ -249,12 +249,12 @@ class NotificationsRemoteMediatorTest {
|
|||
|
||||
db.assertNotifications(
|
||||
listOf(
|
||||
mockNotification(id = "8").toNotificationDataEntity(1),
|
||||
mockNotification(id = "7").toNotificationDataEntity(1),
|
||||
mockNotification(id = "5").toNotificationDataEntity(1),
|
||||
mockNotification(id = "3").toNotificationDataEntity(1),
|
||||
mockNotification(id = "2").toNotificationDataEntity(1),
|
||||
mockNotification(id = "1").toNotificationDataEntity(1)
|
||||
fakeNotification(id = "8").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "7").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "5").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "3").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "2").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "1").toNotificationDataEntity(1)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -263,9 +263,9 @@ class NotificationsRemoteMediatorTest {
|
|||
@ExperimentalPagingApi
|
||||
fun `should refresh and not insert placeholders when there is overlap with existing notifications`() = runTest {
|
||||
val notificationsAlreadyInDb = listOf(
|
||||
mockNotification(id = "3"),
|
||||
mockNotification(id = "2"),
|
||||
mockNotification(id = "1")
|
||||
fakeNotification(id = "3"),
|
||||
fakeNotification(id = "2"),
|
||||
fakeNotification(id = "1")
|
||||
)
|
||||
|
||||
db.insert(notificationsAlreadyInDb)
|
||||
|
@ -275,16 +275,16 @@ class NotificationsRemoteMediatorTest {
|
|||
api = mock {
|
||||
onBlocking { notifications(limit = 3, excludes = emptySet()) } doReturn Response.success(
|
||||
listOf(
|
||||
mockNotification(id = "6"),
|
||||
mockNotification(id = "4"),
|
||||
mockNotification(id = "3")
|
||||
fakeNotification(id = "6"),
|
||||
fakeNotification(id = "4"),
|
||||
fakeNotification(id = "3")
|
||||
)
|
||||
)
|
||||
onBlocking { notifications(maxId = "3", limit = 3, excludes = emptySet()) } doReturn Response.success(
|
||||
listOf(
|
||||
mockNotification(id = "3"),
|
||||
mockNotification(id = "2"),
|
||||
mockNotification(id = "1")
|
||||
fakeNotification(id = "3"),
|
||||
fakeNotification(id = "2"),
|
||||
fakeNotification(id = "1")
|
||||
)
|
||||
)
|
||||
},
|
||||
|
@ -310,11 +310,11 @@ class NotificationsRemoteMediatorTest {
|
|||
|
||||
db.assertNotifications(
|
||||
listOf(
|
||||
mockNotification(id = "6").toNotificationDataEntity(1),
|
||||
mockNotification(id = "4").toNotificationDataEntity(1),
|
||||
mockNotification(id = "3").toNotificationDataEntity(1),
|
||||
mockNotification(id = "2").toNotificationDataEntity(1),
|
||||
mockNotification(id = "1").toNotificationDataEntity(1)
|
||||
fakeNotification(id = "6").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "4").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "3").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "2").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "1").toNotificationDataEntity(1)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -327,9 +327,9 @@ class NotificationsRemoteMediatorTest {
|
|||
api = mock {
|
||||
onBlocking { notifications(limit = 20, excludes = emptySet()) } doReturn Response.success(
|
||||
listOf(
|
||||
mockNotification(id = "5"),
|
||||
mockNotification(id = "4"),
|
||||
mockNotification(id = "3")
|
||||
fakeNotification(id = "5"),
|
||||
fakeNotification(id = "4"),
|
||||
fakeNotification(id = "3")
|
||||
)
|
||||
)
|
||||
},
|
||||
|
@ -354,9 +354,9 @@ class NotificationsRemoteMediatorTest {
|
|||
|
||||
db.assertNotifications(
|
||||
listOf(
|
||||
mockNotification(id = "5").toNotificationDataEntity(1),
|
||||
mockNotification(id = "4").toNotificationDataEntity(1),
|
||||
mockNotification(id = "3").toNotificationDataEntity(1)
|
||||
fakeNotification(id = "5").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "4").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "3").toNotificationDataEntity(1)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -365,9 +365,9 @@ class NotificationsRemoteMediatorTest {
|
|||
@ExperimentalPagingApi
|
||||
fun `should remove deleted notification from db and keep state of statuses in the remaining ones`() = runTest {
|
||||
val notificationsAlreadyInDb = listOf(
|
||||
mockNotification(id = "3"),
|
||||
mockNotification(id = "2"),
|
||||
mockNotification(id = "1")
|
||||
fakeNotification(id = "3"),
|
||||
fakeNotification(id = "2"),
|
||||
fakeNotification(id = "1")
|
||||
)
|
||||
db.insert(notificationsAlreadyInDb)
|
||||
|
||||
|
@ -382,8 +382,8 @@ class NotificationsRemoteMediatorTest {
|
|||
|
||||
onBlocking { notifications(maxId = "3", limit = 20, excludes = emptySet()) } doReturn Response.success(
|
||||
listOf(
|
||||
mockNotification(id = "3"),
|
||||
mockNotification(id = "1")
|
||||
fakeNotification(id = "3"),
|
||||
fakeNotification(id = "1")
|
||||
)
|
||||
)
|
||||
},
|
||||
|
@ -395,9 +395,9 @@ class NotificationsRemoteMediatorTest {
|
|||
listOf(
|
||||
PagingSource.LoadResult.Page(
|
||||
data = listOf(
|
||||
mockNotification(id = "3").toNotificationDataEntity(1, isStatusExpanded = true),
|
||||
mockNotification(id = "2").toNotificationDataEntity(1, isStatusExpanded = true),
|
||||
mockNotification(id = "1").toNotificationDataEntity(1, isStatusContentShowing = true)
|
||||
fakeNotification(id = "3").toNotificationDataEntity(1, isStatusExpanded = true),
|
||||
fakeNotification(id = "2").toNotificationDataEntity(1, isStatusExpanded = true),
|
||||
fakeNotification(id = "1").toNotificationDataEntity(1, isStatusContentShowing = true)
|
||||
),
|
||||
prevKey = null,
|
||||
nextKey = 0
|
||||
|
@ -412,8 +412,8 @@ class NotificationsRemoteMediatorTest {
|
|||
|
||||
db.assertNotifications(
|
||||
listOf(
|
||||
mockNotification(id = "3").toNotificationDataEntity(1, isStatusExpanded = true),
|
||||
mockNotification(id = "1").toNotificationDataEntity(1, isStatusContentShowing = true)
|
||||
fakeNotification(id = "3").toNotificationDataEntity(1, isStatusExpanded = true),
|
||||
fakeNotification(id = "1").toNotificationDataEntity(1, isStatusContentShowing = true)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -422,9 +422,9 @@ class NotificationsRemoteMediatorTest {
|
|||
@ExperimentalPagingApi
|
||||
fun `should not remove placeholder in timeline`() = runTest {
|
||||
val notificationsAlreadyInDb = listOf(
|
||||
mockNotification(id = "8"),
|
||||
mockNotification(id = "7"),
|
||||
mockNotification(id = "1")
|
||||
fakeNotification(id = "8"),
|
||||
fakeNotification(id = "7"),
|
||||
fakeNotification(id = "1")
|
||||
)
|
||||
db.insert(notificationsAlreadyInDb)
|
||||
|
||||
|
@ -436,15 +436,15 @@ class NotificationsRemoteMediatorTest {
|
|||
api = mock {
|
||||
onBlocking { notifications(sinceId = "6", limit = 20, excludes = emptySet()) } doReturn Response.success(
|
||||
listOf(
|
||||
mockNotification(id = "9"),
|
||||
mockNotification(id = "8"),
|
||||
mockNotification(id = "7")
|
||||
fakeNotification(id = "9"),
|
||||
fakeNotification(id = "8"),
|
||||
fakeNotification(id = "7")
|
||||
)
|
||||
)
|
||||
onBlocking { notifications(maxId = "8", sinceId = "6", limit = 20, excludes = emptySet()) } doReturn Response.success(
|
||||
listOf(
|
||||
mockNotification(id = "8"),
|
||||
mockNotification(id = "7")
|
||||
fakeNotification(id = "8"),
|
||||
fakeNotification(id = "7")
|
||||
)
|
||||
)
|
||||
},
|
||||
|
@ -469,11 +469,11 @@ class NotificationsRemoteMediatorTest {
|
|||
|
||||
db.assertNotifications(
|
||||
listOf(
|
||||
mockNotification(id = "9").toNotificationDataEntity(1),
|
||||
mockNotification(id = "8").toNotificationDataEntity(1),
|
||||
mockNotification(id = "7").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "9").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "8").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "7").toNotificationDataEntity(1),
|
||||
Placeholder(id = "6", loading = false).toNotificationDataEntity(1),
|
||||
mockNotification(id = "1").toNotificationDataEntity(1)
|
||||
fakeNotification(id = "1").toNotificationDataEntity(1)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -482,9 +482,9 @@ class NotificationsRemoteMediatorTest {
|
|||
@ExperimentalPagingApi
|
||||
fun `should append notifications`() = runTest {
|
||||
val notificationsAlreadyInDb = listOf(
|
||||
mockNotification(id = "8"),
|
||||
mockNotification(id = "7"),
|
||||
mockNotification(id = "5")
|
||||
fakeNotification(id = "8"),
|
||||
fakeNotification(id = "7"),
|
||||
fakeNotification(id = "5")
|
||||
)
|
||||
|
||||
db.insert(notificationsAlreadyInDb)
|
||||
|
@ -494,9 +494,9 @@ class NotificationsRemoteMediatorTest {
|
|||
api = mock {
|
||||
onBlocking { notifications(maxId = "5", limit = 20, excludes = emptySet()) } doReturn Response.success(
|
||||
listOf(
|
||||
mockNotification(id = "3"),
|
||||
mockNotification(id = "2"),
|
||||
mockNotification(id = "1")
|
||||
fakeNotification(id = "3"),
|
||||
fakeNotification(id = "2"),
|
||||
fakeNotification(id = "1")
|
||||
)
|
||||
)
|
||||
},
|
||||
|
@ -520,12 +520,12 @@ class NotificationsRemoteMediatorTest {
|
|||
assertEquals(false, (result as RemoteMediator.MediatorResult.Success).endOfPaginationReached)
|
||||
db.assertNotifications(
|
||||
listOf(
|
||||
mockNotification(id = "8").toNotificationDataEntity(1),
|
||||
mockNotification(id = "7").toNotificationDataEntity(1),
|
||||
mockNotification(id = "5").toNotificationDataEntity(1),
|
||||
mockNotification(id = "3").toNotificationDataEntity(1),
|
||||
mockNotification(id = "2").toNotificationDataEntity(1),
|
||||
mockNotification(id = "1").toNotificationDataEntity(1)
|
||||
fakeNotification(id = "8").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "7").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "5").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "3").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "2").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "1").toNotificationDataEntity(1)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ class CachedTimelineRemoteMediatorTest {
|
|||
listOf(
|
||||
PagingSource.LoadResult.Page(
|
||||
data = listOf(
|
||||
mockHomeTimelineData("3")
|
||||
fakeHomeTimelineData("3")
|
||||
),
|
||||
prevKey = null,
|
||||
nextKey = 1
|
||||
|
@ -139,9 +139,9 @@ class CachedTimelineRemoteMediatorTest {
|
|||
@ExperimentalPagingApi
|
||||
fun `should refresh and insert placeholder when a whole page with no overlap to existing statuses is loaded`() = runTest {
|
||||
val statusesAlreadyInDb = listOf(
|
||||
mockHomeTimelineData("3"),
|
||||
mockHomeTimelineData("2"),
|
||||
mockHomeTimelineData("1")
|
||||
fakeHomeTimelineData("3"),
|
||||
fakeHomeTimelineData("2"),
|
||||
fakeHomeTimelineData("1")
|
||||
)
|
||||
|
||||
db.insert(statusesAlreadyInDb)
|
||||
|
@ -151,16 +151,16 @@ class CachedTimelineRemoteMediatorTest {
|
|||
api = mock {
|
||||
onBlocking { homeTimeline(limit = 3) } doReturn Response.success(
|
||||
listOf(
|
||||
mockStatus("8"),
|
||||
mockStatus("7"),
|
||||
mockStatus("5")
|
||||
fakeStatus("8"),
|
||||
fakeStatus("7"),
|
||||
fakeStatus("5")
|
||||
)
|
||||
)
|
||||
onBlocking { homeTimeline(maxId = "3", limit = 3) } doReturn Response.success(
|
||||
listOf(
|
||||
mockStatus("3"),
|
||||
mockStatus("2"),
|
||||
mockStatus("1")
|
||||
fakeStatus("3"),
|
||||
fakeStatus("2"),
|
||||
fakeStatus("1")
|
||||
)
|
||||
)
|
||||
},
|
||||
|
@ -185,12 +185,12 @@ class CachedTimelineRemoteMediatorTest {
|
|||
|
||||
db.assertTimeline(
|
||||
listOf(
|
||||
mockHomeTimelineData("8"),
|
||||
mockHomeTimelineData("7"),
|
||||
mockPlaceholderHomeTimelineData("5"),
|
||||
mockHomeTimelineData("3"),
|
||||
mockHomeTimelineData("2"),
|
||||
mockHomeTimelineData("1")
|
||||
fakeHomeTimelineData("8"),
|
||||
fakeHomeTimelineData("7"),
|
||||
fakePlaceholderHomeTimelineData("5"),
|
||||
fakeHomeTimelineData("3"),
|
||||
fakeHomeTimelineData("2"),
|
||||
fakeHomeTimelineData("1")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -199,9 +199,9 @@ class CachedTimelineRemoteMediatorTest {
|
|||
@ExperimentalPagingApi
|
||||
fun `should refresh and not insert placeholder when less than a whole page is loaded`() = runTest {
|
||||
val statusesAlreadyInDb = listOf(
|
||||
mockHomeTimelineData("3"),
|
||||
mockHomeTimelineData("2"),
|
||||
mockHomeTimelineData("1")
|
||||
fakeHomeTimelineData("3"),
|
||||
fakeHomeTimelineData("2"),
|
||||
fakeHomeTimelineData("1")
|
||||
)
|
||||
|
||||
db.insert(statusesAlreadyInDb)
|
||||
|
@ -211,16 +211,16 @@ class CachedTimelineRemoteMediatorTest {
|
|||
api = mock {
|
||||
onBlocking { homeTimeline(limit = 20) } doReturn Response.success(
|
||||
listOf(
|
||||
mockStatus("8"),
|
||||
mockStatus("7"),
|
||||
mockStatus("5")
|
||||
fakeStatus("8"),
|
||||
fakeStatus("7"),
|
||||
fakeStatus("5")
|
||||
)
|
||||
)
|
||||
onBlocking { homeTimeline(maxId = "3", limit = 20) } doReturn Response.success(
|
||||
listOf(
|
||||
mockStatus("3"),
|
||||
mockStatus("2"),
|
||||
mockStatus("1")
|
||||
fakeStatus("3"),
|
||||
fakeStatus("2"),
|
||||
fakeStatus("1")
|
||||
)
|
||||
)
|
||||
},
|
||||
|
@ -244,12 +244,12 @@ class CachedTimelineRemoteMediatorTest {
|
|||
|
||||
db.assertTimeline(
|
||||
listOf(
|
||||
mockHomeTimelineData("8"),
|
||||
mockHomeTimelineData("7"),
|
||||
mockHomeTimelineData("5"),
|
||||
mockHomeTimelineData("3"),
|
||||
mockHomeTimelineData("2"),
|
||||
mockHomeTimelineData("1")
|
||||
fakeHomeTimelineData("8"),
|
||||
fakeHomeTimelineData("7"),
|
||||
fakeHomeTimelineData("5"),
|
||||
fakeHomeTimelineData("3"),
|
||||
fakeHomeTimelineData("2"),
|
||||
fakeHomeTimelineData("1")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -258,9 +258,9 @@ class CachedTimelineRemoteMediatorTest {
|
|||
@ExperimentalPagingApi
|
||||
fun `should refresh and not insert placeholders when there is overlap with existing statuses`() = runTest {
|
||||
val statusesAlreadyInDb = listOf(
|
||||
mockHomeTimelineData("3"),
|
||||
mockHomeTimelineData("2"),
|
||||
mockHomeTimelineData("1")
|
||||
fakeHomeTimelineData("3"),
|
||||
fakeHomeTimelineData("2"),
|
||||
fakeHomeTimelineData("1")
|
||||
)
|
||||
|
||||
db.insert(statusesAlreadyInDb)
|
||||
|
@ -270,16 +270,16 @@ class CachedTimelineRemoteMediatorTest {
|
|||
api = mock {
|
||||
onBlocking { homeTimeline(limit = 3) } doReturn Response.success(
|
||||
listOf(
|
||||
mockStatus("6"),
|
||||
mockStatus("4"),
|
||||
mockStatus("3")
|
||||
fakeStatus("6"),
|
||||
fakeStatus("4"),
|
||||
fakeStatus("3")
|
||||
)
|
||||
)
|
||||
onBlocking { homeTimeline(maxId = "3", limit = 3) } doReturn Response.success(
|
||||
listOf(
|
||||
mockStatus("3"),
|
||||
mockStatus("2"),
|
||||
mockStatus("1")
|
||||
fakeStatus("3"),
|
||||
fakeStatus("2"),
|
||||
fakeStatus("1")
|
||||
)
|
||||
)
|
||||
},
|
||||
|
@ -304,11 +304,11 @@ class CachedTimelineRemoteMediatorTest {
|
|||
|
||||
db.assertTimeline(
|
||||
listOf(
|
||||
mockHomeTimelineData("6"),
|
||||
mockHomeTimelineData("4"),
|
||||
mockHomeTimelineData("3"),
|
||||
mockHomeTimelineData("2"),
|
||||
mockHomeTimelineData("1")
|
||||
fakeHomeTimelineData("6"),
|
||||
fakeHomeTimelineData("4"),
|
||||
fakeHomeTimelineData("3"),
|
||||
fakeHomeTimelineData("2"),
|
||||
fakeHomeTimelineData("1")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -321,9 +321,9 @@ class CachedTimelineRemoteMediatorTest {
|
|||
api = mock {
|
||||
onBlocking { homeTimeline(limit = 20) } doReturn Response.success(
|
||||
listOf(
|
||||
mockStatus("5"),
|
||||
mockStatus("4"),
|
||||
mockStatus("3")
|
||||
fakeStatus("5"),
|
||||
fakeStatus("4"),
|
||||
fakeStatus("3")
|
||||
)
|
||||
)
|
||||
},
|
||||
|
@ -347,9 +347,9 @@ class CachedTimelineRemoteMediatorTest {
|
|||
|
||||
db.assertTimeline(
|
||||
listOf(
|
||||
mockHomeTimelineData("5"),
|
||||
mockHomeTimelineData("4"),
|
||||
mockHomeTimelineData("3")
|
||||
fakeHomeTimelineData("5"),
|
||||
fakeHomeTimelineData("4"),
|
||||
fakeHomeTimelineData("3")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -358,9 +358,9 @@ class CachedTimelineRemoteMediatorTest {
|
|||
@ExperimentalPagingApi
|
||||
fun `should remove deleted status from db and keep state of other cached statuses`() = runTest {
|
||||
val statusesAlreadyInDb = listOf(
|
||||
mockHomeTimelineData("3", expanded = true),
|
||||
mockHomeTimelineData("2"),
|
||||
mockHomeTimelineData("1", expanded = false)
|
||||
fakeHomeTimelineData("3", expanded = true),
|
||||
fakeHomeTimelineData("2"),
|
||||
fakeHomeTimelineData("1", expanded = false)
|
||||
)
|
||||
|
||||
db.insert(statusesAlreadyInDb)
|
||||
|
@ -372,8 +372,8 @@ class CachedTimelineRemoteMediatorTest {
|
|||
|
||||
onBlocking { homeTimeline(maxId = "3", limit = 20) } doReturn Response.success(
|
||||
listOf(
|
||||
mockStatus("3"),
|
||||
mockStatus("1")
|
||||
fakeStatus("3"),
|
||||
fakeStatus("1")
|
||||
)
|
||||
)
|
||||
},
|
||||
|
@ -397,8 +397,8 @@ class CachedTimelineRemoteMediatorTest {
|
|||
|
||||
db.assertTimeline(
|
||||
listOf(
|
||||
mockHomeTimelineData("3", expanded = true),
|
||||
mockHomeTimelineData("1", expanded = false)
|
||||
fakeHomeTimelineData("3", expanded = true),
|
||||
fakeHomeTimelineData("1", expanded = false)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -407,10 +407,10 @@ class CachedTimelineRemoteMediatorTest {
|
|||
@ExperimentalPagingApi
|
||||
fun `should not remove placeholder in timeline`() = runTest {
|
||||
val statusesAlreadyInDb = listOf(
|
||||
mockHomeTimelineData("8"),
|
||||
mockHomeTimelineData("7"),
|
||||
mockPlaceholderHomeTimelineData("6"),
|
||||
mockHomeTimelineData("1")
|
||||
fakeHomeTimelineData("8"),
|
||||
fakeHomeTimelineData("7"),
|
||||
fakePlaceholderHomeTimelineData("6"),
|
||||
fakeHomeTimelineData("1")
|
||||
)
|
||||
|
||||
db.insert(statusesAlreadyInDb)
|
||||
|
@ -420,15 +420,15 @@ class CachedTimelineRemoteMediatorTest {
|
|||
api = mock {
|
||||
onBlocking { homeTimeline(sinceId = "6", limit = 20) } doReturn Response.success(
|
||||
listOf(
|
||||
mockStatus("9"),
|
||||
mockStatus("8"),
|
||||
mockStatus("7")
|
||||
fakeStatus("9"),
|
||||
fakeStatus("8"),
|
||||
fakeStatus("7")
|
||||
)
|
||||
)
|
||||
onBlocking { homeTimeline(maxId = "8", sinceId = "6", limit = 20) } doReturn Response.success(
|
||||
listOf(
|
||||
mockStatus("8"),
|
||||
mockStatus("7")
|
||||
fakeStatus("8"),
|
||||
fakeStatus("7")
|
||||
)
|
||||
)
|
||||
},
|
||||
|
@ -452,11 +452,11 @@ class CachedTimelineRemoteMediatorTest {
|
|||
|
||||
db.assertTimeline(
|
||||
listOf(
|
||||
mockHomeTimelineData("9"),
|
||||
mockHomeTimelineData("8"),
|
||||
mockHomeTimelineData("7"),
|
||||
mockPlaceholderHomeTimelineData("6"),
|
||||
mockHomeTimelineData("1")
|
||||
fakeHomeTimelineData("9"),
|
||||
fakeHomeTimelineData("8"),
|
||||
fakeHomeTimelineData("7"),
|
||||
fakePlaceholderHomeTimelineData("6"),
|
||||
fakeHomeTimelineData("1")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -465,9 +465,9 @@ class CachedTimelineRemoteMediatorTest {
|
|||
@ExperimentalPagingApi
|
||||
fun `should append statuses`() = runTest {
|
||||
val statusesAlreadyInDb = listOf(
|
||||
mockHomeTimelineData("8"),
|
||||
mockHomeTimelineData("7"),
|
||||
mockHomeTimelineData("5")
|
||||
fakeHomeTimelineData("8"),
|
||||
fakeHomeTimelineData("7"),
|
||||
fakeHomeTimelineData("5")
|
||||
)
|
||||
|
||||
db.insert(statusesAlreadyInDb)
|
||||
|
@ -477,9 +477,9 @@ class CachedTimelineRemoteMediatorTest {
|
|||
api = mock {
|
||||
onBlocking { homeTimeline(maxId = "5", limit = 20) } doReturn Response.success(
|
||||
listOf(
|
||||
mockStatus("3"),
|
||||
mockStatus("2"),
|
||||
mockStatus("1")
|
||||
fakeStatus("3"),
|
||||
fakeStatus("2"),
|
||||
fakeStatus("1")
|
||||
)
|
||||
)
|
||||
},
|
||||
|
@ -502,12 +502,12 @@ class CachedTimelineRemoteMediatorTest {
|
|||
assertEquals(false, (result as RemoteMediator.MediatorResult.Success).endOfPaginationReached)
|
||||
db.assertTimeline(
|
||||
listOf(
|
||||
mockHomeTimelineData("8"),
|
||||
mockHomeTimelineData("7"),
|
||||
mockHomeTimelineData("5"),
|
||||
mockHomeTimelineData("3"),
|
||||
mockHomeTimelineData("2"),
|
||||
mockHomeTimelineData("1")
|
||||
fakeHomeTimelineData("8"),
|
||||
fakeHomeTimelineData("7"),
|
||||
fakeHomeTimelineData("5"),
|
||||
fakeHomeTimelineData("3"),
|
||||
fakeHomeTimelineData("2"),
|
||||
fakeHomeTimelineData("1")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ import org.robolectric.annotation.Config
|
|||
@RunWith(AndroidJUnit4::class)
|
||||
class NetworkTimelinePagingSourceTest {
|
||||
|
||||
private val status = mockStatusViewData()
|
||||
private val status = fakeStatusViewData()
|
||||
|
||||
private val timelineViewModel: NetworkTimelineViewModel = mock {
|
||||
on { statusData } doReturn mutableListOf(status)
|
||||
|
|
|
@ -88,9 +88,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
on { nextKey } doReturn null
|
||||
onBlocking { fetchStatusesForKind(null, null, 20) } doReturn Response.success(
|
||||
listOf(
|
||||
mockStatus("7"),
|
||||
mockStatus("6"),
|
||||
mockStatus("5")
|
||||
fakeStatus("7"),
|
||||
fakeStatus("6"),
|
||||
fakeStatus("5")
|
||||
),
|
||||
Headers.headersOf(
|
||||
"Link",
|
||||
|
@ -114,9 +114,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
val result = runBlocking { remoteMediator.load(LoadType.REFRESH, state) }
|
||||
|
||||
val newStatusData = mutableListOf(
|
||||
mockStatusViewData("7"),
|
||||
mockStatusViewData("6"),
|
||||
mockStatusViewData("5")
|
||||
fakeStatusViewData("7"),
|
||||
fakeStatusViewData("6"),
|
||||
fakeStatusViewData("5")
|
||||
)
|
||||
|
||||
verify(timelineViewModel).nextKey = "4"
|
||||
|
@ -129,9 +129,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
@ExperimentalPagingApi
|
||||
fun `should not prepend statuses`() {
|
||||
val statuses: MutableList<StatusViewData> = mutableListOf(
|
||||
mockStatusViewData("3"),
|
||||
mockStatusViewData("2"),
|
||||
mockStatusViewData("1")
|
||||
fakeStatusViewData("3"),
|
||||
fakeStatusViewData("2"),
|
||||
fakeStatusViewData("1")
|
||||
)
|
||||
|
||||
val timelineViewModel: NetworkTimelineViewModel = mock {
|
||||
|
@ -139,9 +139,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
on { nextKey } doReturn "0"
|
||||
onBlocking { fetchStatusesForKind(null, null, 20) } doReturn Response.success(
|
||||
listOf(
|
||||
mockStatus("5"),
|
||||
mockStatus("4"),
|
||||
mockStatus("3")
|
||||
fakeStatus("5"),
|
||||
fakeStatus("4"),
|
||||
fakeStatus("3")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -152,9 +152,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
listOf(
|
||||
PagingSource.LoadResult.Page(
|
||||
data = listOf(
|
||||
mockStatusViewData("3"),
|
||||
mockStatusViewData("2"),
|
||||
mockStatusViewData("1")
|
||||
fakeStatusViewData("3"),
|
||||
fakeStatusViewData("2"),
|
||||
fakeStatusViewData("1")
|
||||
),
|
||||
prevKey = null,
|
||||
nextKey = "0"
|
||||
|
@ -165,11 +165,11 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
val result = runBlocking { remoteMediator.load(LoadType.REFRESH, state) }
|
||||
|
||||
val newStatusData = mutableListOf(
|
||||
mockStatusViewData("5"),
|
||||
mockStatusViewData("4"),
|
||||
mockStatusViewData("3"),
|
||||
mockStatusViewData("2"),
|
||||
mockStatusViewData("1")
|
||||
fakeStatusViewData("5"),
|
||||
fakeStatusViewData("4"),
|
||||
fakeStatusViewData("3"),
|
||||
fakeStatusViewData("2"),
|
||||
fakeStatusViewData("1")
|
||||
)
|
||||
|
||||
assertTrue(result is RemoteMediator.MediatorResult.Success)
|
||||
|
@ -181,9 +181,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
@ExperimentalPagingApi
|
||||
fun `should refresh and insert placeholder`() {
|
||||
val statuses: MutableList<StatusViewData> = mutableListOf(
|
||||
mockStatusViewData("3"),
|
||||
mockStatusViewData("2"),
|
||||
mockStatusViewData("1")
|
||||
fakeStatusViewData("3"),
|
||||
fakeStatusViewData("2"),
|
||||
fakeStatusViewData("1")
|
||||
)
|
||||
|
||||
val timelineViewModel: NetworkTimelineViewModel = mock {
|
||||
|
@ -191,9 +191,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
on { nextKey } doReturn "0"
|
||||
onBlocking { fetchStatusesForKind(null, null, 20) } doReturn Response.success(
|
||||
listOf(
|
||||
mockStatus("10"),
|
||||
mockStatus("9"),
|
||||
mockStatus("7")
|
||||
fakeStatus("10"),
|
||||
fakeStatus("9"),
|
||||
fakeStatus("7")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -204,9 +204,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
listOf(
|
||||
PagingSource.LoadResult.Page(
|
||||
data = listOf(
|
||||
mockStatusViewData("3"),
|
||||
mockStatusViewData("2"),
|
||||
mockStatusViewData("1")
|
||||
fakeStatusViewData("3"),
|
||||
fakeStatusViewData("2"),
|
||||
fakeStatusViewData("1")
|
||||
),
|
||||
prevKey = null,
|
||||
nextKey = "0"
|
||||
|
@ -217,12 +217,12 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
val result = runBlocking { remoteMediator.load(LoadType.REFRESH, state) }
|
||||
|
||||
val newStatusData = mutableListOf(
|
||||
mockStatusViewData("10"),
|
||||
mockStatusViewData("9"),
|
||||
fakeStatusViewData("10"),
|
||||
fakeStatusViewData("9"),
|
||||
StatusViewData.Placeholder("7", false),
|
||||
mockStatusViewData("3"),
|
||||
mockStatusViewData("2"),
|
||||
mockStatusViewData("1")
|
||||
fakeStatusViewData("3"),
|
||||
fakeStatusViewData("2"),
|
||||
fakeStatusViewData("1")
|
||||
)
|
||||
|
||||
assertTrue(result is RemoteMediator.MediatorResult.Success)
|
||||
|
@ -234,9 +234,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
@ExperimentalPagingApi
|
||||
fun `should refresh and not insert placeholders`() {
|
||||
val statuses: MutableList<StatusViewData> = mutableListOf(
|
||||
mockStatusViewData("8"),
|
||||
mockStatusViewData("7"),
|
||||
mockStatusViewData("5")
|
||||
fakeStatusViewData("8"),
|
||||
fakeStatusViewData("7"),
|
||||
fakeStatusViewData("5")
|
||||
)
|
||||
|
||||
val timelineViewModel: NetworkTimelineViewModel = mock {
|
||||
|
@ -244,9 +244,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
on { nextKey } doReturn "3"
|
||||
onBlocking { fetchStatusesForKind("3", null, 20) } doReturn Response.success(
|
||||
listOf(
|
||||
mockStatus("3"),
|
||||
mockStatus("2"),
|
||||
mockStatus("1")
|
||||
fakeStatus("3"),
|
||||
fakeStatus("2"),
|
||||
fakeStatus("1")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -257,9 +257,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
listOf(
|
||||
PagingSource.LoadResult.Page(
|
||||
data = listOf(
|
||||
mockStatusViewData("8"),
|
||||
mockStatusViewData("7"),
|
||||
mockStatusViewData("5")
|
||||
fakeStatusViewData("8"),
|
||||
fakeStatusViewData("7"),
|
||||
fakeStatusViewData("5")
|
||||
),
|
||||
prevKey = null,
|
||||
nextKey = "3"
|
||||
|
@ -270,12 +270,12 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
val result = runBlocking { remoteMediator.load(LoadType.APPEND, state) }
|
||||
|
||||
val newStatusData = mutableListOf(
|
||||
mockStatusViewData("8"),
|
||||
mockStatusViewData("7"),
|
||||
mockStatusViewData("5"),
|
||||
mockStatusViewData("3"),
|
||||
mockStatusViewData("2"),
|
||||
mockStatusViewData("1")
|
||||
fakeStatusViewData("8"),
|
||||
fakeStatusViewData("7"),
|
||||
fakeStatusViewData("5"),
|
||||
fakeStatusViewData("3"),
|
||||
fakeStatusViewData("2"),
|
||||
fakeStatusViewData("1")
|
||||
)
|
||||
|
||||
assertTrue(result is RemoteMediator.MediatorResult.Success)
|
||||
|
@ -287,9 +287,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
@ExperimentalPagingApi
|
||||
fun `should append statuses`() {
|
||||
val statuses: MutableList<StatusViewData> = mutableListOf(
|
||||
mockStatusViewData("8"),
|
||||
mockStatusViewData("7"),
|
||||
mockStatusViewData("5")
|
||||
fakeStatusViewData("8"),
|
||||
fakeStatusViewData("7"),
|
||||
fakeStatusViewData("5")
|
||||
)
|
||||
|
||||
val timelineViewModel: NetworkTimelineViewModel = mock {
|
||||
|
@ -297,9 +297,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
on { nextKey } doReturn "3"
|
||||
onBlocking { fetchStatusesForKind("3", null, 20) } doReturn Response.success(
|
||||
listOf(
|
||||
mockStatus("3"),
|
||||
mockStatus("2"),
|
||||
mockStatus("1")
|
||||
fakeStatus("3"),
|
||||
fakeStatus("2"),
|
||||
fakeStatus("1")
|
||||
),
|
||||
Headers.headersOf(
|
||||
"Link",
|
||||
|
@ -314,9 +314,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
listOf(
|
||||
PagingSource.LoadResult.Page(
|
||||
data = listOf(
|
||||
mockStatusViewData("8"),
|
||||
mockStatusViewData("7"),
|
||||
mockStatusViewData("5")
|
||||
fakeStatusViewData("8"),
|
||||
fakeStatusViewData("7"),
|
||||
fakeStatusViewData("5")
|
||||
),
|
||||
prevKey = null,
|
||||
nextKey = "3"
|
||||
|
@ -327,12 +327,12 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
val result = runBlocking { remoteMediator.load(LoadType.APPEND, state) }
|
||||
|
||||
val newStatusData = mutableListOf(
|
||||
mockStatusViewData("8"),
|
||||
mockStatusViewData("7"),
|
||||
mockStatusViewData("5"),
|
||||
mockStatusViewData("3"),
|
||||
mockStatusViewData("2"),
|
||||
mockStatusViewData("1")
|
||||
fakeStatusViewData("8"),
|
||||
fakeStatusViewData("7"),
|
||||
fakeStatusViewData("5"),
|
||||
fakeStatusViewData("3"),
|
||||
fakeStatusViewData("2"),
|
||||
fakeStatusViewData("1")
|
||||
)
|
||||
verify(timelineViewModel).nextKey = "0"
|
||||
assertTrue(result is RemoteMediator.MediatorResult.Success)
|
||||
|
@ -344,9 +344,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
@ExperimentalPagingApi
|
||||
fun `should not append statuses when pagination end has been reached`() {
|
||||
val statuses: MutableList<StatusViewData> = mutableListOf(
|
||||
mockStatusViewData("8"),
|
||||
mockStatusViewData("7"),
|
||||
mockStatusViewData("5")
|
||||
fakeStatusViewData("8"),
|
||||
fakeStatusViewData("7"),
|
||||
fakeStatusViewData("5")
|
||||
)
|
||||
|
||||
val timelineViewModel: NetworkTimelineViewModel = mock {
|
||||
|
@ -360,9 +360,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
listOf(
|
||||
PagingSource.LoadResult.Page(
|
||||
data = listOf(
|
||||
mockStatusViewData("8"),
|
||||
mockStatusViewData("7"),
|
||||
mockStatusViewData("5")
|
||||
fakeStatusViewData("8"),
|
||||
fakeStatusViewData("7"),
|
||||
fakeStatusViewData("5")
|
||||
),
|
||||
prevKey = null,
|
||||
nextKey = null
|
||||
|
@ -373,9 +373,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
val result = runBlocking { remoteMediator.load(LoadType.APPEND, state) }
|
||||
|
||||
val newStatusData = mutableListOf(
|
||||
mockStatusViewData("8"),
|
||||
mockStatusViewData("7"),
|
||||
mockStatusViewData("5")
|
||||
fakeStatusViewData("8"),
|
||||
fakeStatusViewData("7"),
|
||||
fakeStatusViewData("5")
|
||||
)
|
||||
|
||||
assertTrue(result is RemoteMediator.MediatorResult.Success)
|
||||
|
@ -387,9 +387,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
@ExperimentalPagingApi
|
||||
fun `should not append duplicates for trending statuses`() {
|
||||
val statuses: MutableList<StatusViewData> = mutableListOf(
|
||||
mockStatusViewData("5"),
|
||||
mockStatusViewData("4"),
|
||||
mockStatusViewData("3")
|
||||
fakeStatusViewData("5"),
|
||||
fakeStatusViewData("4"),
|
||||
fakeStatusViewData("3")
|
||||
)
|
||||
|
||||
val timelineViewModel: NetworkTimelineViewModel = mock {
|
||||
|
@ -398,9 +398,9 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
on { kind } doReturn TimelineViewModel.Kind.PUBLIC_TRENDING_STATUSES
|
||||
onBlocking { fetchStatusesForKind("3", null, 20) } doReturn Response.success(
|
||||
listOf(
|
||||
mockStatus("3"),
|
||||
mockStatus("2"),
|
||||
mockStatus("1")
|
||||
fakeStatus("3"),
|
||||
fakeStatus("2"),
|
||||
fakeStatus("1")
|
||||
),
|
||||
Headers.headersOf(
|
||||
"Link",
|
||||
|
@ -424,11 +424,11 @@ class NetworkTimelineRemoteMediatorTest {
|
|||
val result = runBlocking { remoteMediator.load(LoadType.APPEND, state) }
|
||||
|
||||
val newStatusData = mutableListOf(
|
||||
mockStatusViewData("5"),
|
||||
mockStatusViewData("4"),
|
||||
mockStatusViewData("3"),
|
||||
mockStatusViewData("2"),
|
||||
mockStatusViewData("1")
|
||||
fakeStatusViewData("5"),
|
||||
fakeStatusViewData("4"),
|
||||
fakeStatusViewData("3"),
|
||||
fakeStatusViewData("2"),
|
||||
fakeStatusViewData("1")
|
||||
)
|
||||
verify(timelineViewModel).nextKey = "5"
|
||||
assertTrue(result is RemoteMediator.MediatorResult.Success)
|
||||
|
|
|
@ -13,7 +13,7 @@ import org.junit.Assert.assertEquals
|
|||
|
||||
private val fixedDate = Date(1638889052000)
|
||||
|
||||
fun mockAccount(
|
||||
fun fakeAccount(
|
||||
id: String = "100",
|
||||
domain: String = "mastodon.example"
|
||||
) = TimelineAccount(
|
||||
|
@ -26,7 +26,7 @@ fun mockAccount(
|
|||
avatar = "https://$domain/system/accounts/avatars/000/150/486/original/ab27d7ddd18a10ea.jpg"
|
||||
)
|
||||
|
||||
fun mockStatus(
|
||||
fun fakeStatus(
|
||||
id: String = "100",
|
||||
authorServerId: String = "100",
|
||||
inReplyToId: String? = null,
|
||||
|
@ -39,7 +39,7 @@ fun mockStatus(
|
|||
) = Status(
|
||||
id = id,
|
||||
url = "https://$domain/@ConnyDuck/$id",
|
||||
account = mockAccount(
|
||||
account = fakeAccount(
|
||||
id = authorServerId,
|
||||
domain = domain
|
||||
),
|
||||
|
@ -71,7 +71,7 @@ fun mockStatus(
|
|||
filtered = emptyList()
|
||||
)
|
||||
|
||||
fun mockStatusViewData(
|
||||
fun fakeStatusViewData(
|
||||
id: String = "100",
|
||||
inReplyToId: String? = null,
|
||||
inReplyToAccountId: String? = null,
|
||||
|
@ -84,7 +84,7 @@ fun mockStatusViewData(
|
|||
favourited: Boolean = true,
|
||||
bookmarked: Boolean = true
|
||||
) = StatusViewData.Concrete(
|
||||
status = mockStatus(
|
||||
status = fakeStatus(
|
||||
id = id,
|
||||
inReplyToId = inReplyToId,
|
||||
inReplyToAccountId = inReplyToAccountId,
|
||||
|
@ -99,7 +99,7 @@ fun mockStatusViewData(
|
|||
isDetailed = isDetailed
|
||||
)
|
||||
|
||||
fun mockHomeTimelineData(
|
||||
fun fakeHomeTimelineData(
|
||||
id: String = "100",
|
||||
statusId: String = id,
|
||||
tuskyAccountId: Long = 1,
|
||||
|
@ -108,7 +108,7 @@ fun mockHomeTimelineData(
|
|||
domain: String = "mastodon.example",
|
||||
reblogAuthorServerId: String? = null
|
||||
): HomeTimelineData {
|
||||
val mockedStatus = mockStatus(
|
||||
val mockedStatus = fakeStatus(
|
||||
id = statusId,
|
||||
authorServerId = authorServerId,
|
||||
domain = domain
|
||||
|
@ -126,7 +126,7 @@ fun mockHomeTimelineData(
|
|||
tuskyAccountId = tuskyAccountId,
|
||||
),
|
||||
reblogAccount = reblogAuthorServerId?.let { reblogAuthorId ->
|
||||
mockAccount(
|
||||
fakeAccount(
|
||||
id = reblogAuthorId
|
||||
).toEntity(
|
||||
tuskyAccountId = tuskyAccountId,
|
||||
|
@ -136,7 +136,7 @@ fun mockHomeTimelineData(
|
|||
)
|
||||
}
|
||||
|
||||
fun mockPlaceholderHomeTimelineData(
|
||||
fun fakePlaceholderHomeTimelineData(
|
||||
id: String
|
||||
) = HomeTimelineData(
|
||||
id = id,
|
|
@ -8,8 +8,8 @@ import androidx.test.platform.app.InstrumentationRegistry
|
|||
import at.connyduck.calladapter.networkresult.NetworkResult
|
||||
import com.keylesspalace.tusky.appstore.EventHub
|
||||
import com.keylesspalace.tusky.appstore.StatusChangedEvent
|
||||
import com.keylesspalace.tusky.components.timeline.mockStatus
|
||||
import com.keylesspalace.tusky.components.timeline.mockStatusViewData
|
||||
import com.keylesspalace.tusky.components.timeline.fakeStatus
|
||||
import com.keylesspalace.tusky.components.timeline.fakeStatusViewData
|
||||
import com.keylesspalace.tusky.db.AccountManager
|
||||
import com.keylesspalace.tusky.db.AppDatabase
|
||||
import com.keylesspalace.tusky.db.Converters
|
||||
|
@ -118,9 +118,9 @@ class ViewThreadViewModelTest {
|
|||
assertEquals(
|
||||
ThreadUiState.Success(
|
||||
statusViewData = listOf(
|
||||
mockStatusViewData(id = "1", spoilerText = "Test"),
|
||||
mockStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test"),
|
||||
mockStatusViewData(id = "3", inReplyToId = "2", inReplyToAccountId = "1", spoilerText = "Test")
|
||||
fakeStatusViewData(id = "1", spoilerText = "Test"),
|
||||
fakeStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test"),
|
||||
fakeStatusViewData(id = "3", inReplyToId = "2", inReplyToAccountId = "1", spoilerText = "Test")
|
||||
),
|
||||
detailedStatusPosition = 1,
|
||||
revealButton = RevealButtonState.REVEAL
|
||||
|
@ -133,7 +133,7 @@ class ViewThreadViewModelTest {
|
|||
@Test
|
||||
fun `should emit status even if context fails to load`() {
|
||||
api.stub {
|
||||
onBlocking { status(threadId) } doReturn NetworkResult.success(mockStatus(id = "2", inReplyToId = "1", inReplyToAccountId = "1"))
|
||||
onBlocking { status(threadId) } doReturn NetworkResult.success(fakeStatus(id = "2", inReplyToId = "1", inReplyToAccountId = "1"))
|
||||
onBlocking { statusContext(threadId) } doReturn NetworkResult.failure(IOException())
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@ class ViewThreadViewModelTest {
|
|||
assertEquals(
|
||||
ThreadUiState.Success(
|
||||
statusViewData = listOf(
|
||||
mockStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true)
|
||||
fakeStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true)
|
||||
),
|
||||
detailedStatusPosition = 0,
|
||||
revealButton = RevealButtonState.NO_BUTTON
|
||||
|
@ -176,8 +176,8 @@ class ViewThreadViewModelTest {
|
|||
onBlocking { status(threadId) } doReturn NetworkResult.failure(IOException())
|
||||
onBlocking { statusContext(threadId) } doReturn NetworkResult.success(
|
||||
StatusContext(
|
||||
ancestors = listOf(mockStatus(id = "1")),
|
||||
descendants = listOf(mockStatus(id = "3", inReplyToId = "2", inReplyToAccountId = "1"))
|
||||
ancestors = listOf(fakeStatus(id = "1")),
|
||||
descendants = listOf(fakeStatus(id = "3", inReplyToId = "2", inReplyToAccountId = "1"))
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -203,9 +203,9 @@ class ViewThreadViewModelTest {
|
|||
assertEquals(
|
||||
ThreadUiState.Success(
|
||||
statusViewData = listOf(
|
||||
mockStatusViewData(id = "1", spoilerText = "Test", isExpanded = true),
|
||||
mockStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test", isExpanded = true),
|
||||
mockStatusViewData(id = "3", inReplyToId = "2", inReplyToAccountId = "1", spoilerText = "Test", isExpanded = true)
|
||||
fakeStatusViewData(id = "1", spoilerText = "Test", isExpanded = true),
|
||||
fakeStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test", isExpanded = true),
|
||||
fakeStatusViewData(id = "3", inReplyToId = "2", inReplyToAccountId = "1", spoilerText = "Test", isExpanded = true)
|
||||
),
|
||||
detailedStatusPosition = 1,
|
||||
revealButton = RevealButtonState.HIDE
|
||||
|
@ -222,14 +222,14 @@ class ViewThreadViewModelTest {
|
|||
viewModel.loadThread(threadId)
|
||||
|
||||
runBlocking {
|
||||
eventHub.dispatch(StatusChangedEvent(mockStatus(id = "1", spoilerText = "Test", favourited = false)))
|
||||
eventHub.dispatch(StatusChangedEvent(fakeStatus(id = "1", spoilerText = "Test", favourited = false)))
|
||||
|
||||
assertEquals(
|
||||
ThreadUiState.Success(
|
||||
statusViewData = listOf(
|
||||
mockStatusViewData(id = "1", spoilerText = "Test", favourited = false),
|
||||
mockStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test"),
|
||||
mockStatusViewData(id = "3", inReplyToId = "2", inReplyToAccountId = "1", spoilerText = "Test")
|
||||
fakeStatusViewData(id = "1", spoilerText = "Test", favourited = false),
|
||||
fakeStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test"),
|
||||
fakeStatusViewData(id = "3", inReplyToId = "2", inReplyToAccountId = "1", spoilerText = "Test")
|
||||
),
|
||||
detailedStatusPosition = 1,
|
||||
revealButton = RevealButtonState.REVEAL
|
||||
|
@ -245,14 +245,14 @@ class ViewThreadViewModelTest {
|
|||
|
||||
viewModel.loadThread(threadId)
|
||||
|
||||
viewModel.removeStatus(mockStatusViewData(id = "3", inReplyToId = "2", inReplyToAccountId = "1", spoilerText = "Test"))
|
||||
viewModel.removeStatus(fakeStatusViewData(id = "3", inReplyToId = "2", inReplyToAccountId = "1", spoilerText = "Test"))
|
||||
|
||||
runBlocking {
|
||||
assertEquals(
|
||||
ThreadUiState.Success(
|
||||
statusViewData = listOf(
|
||||
mockStatusViewData(id = "1", spoilerText = "Test"),
|
||||
mockStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test")
|
||||
fakeStatusViewData(id = "1", spoilerText = "Test"),
|
||||
fakeStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test")
|
||||
),
|
||||
detailedStatusPosition = 1,
|
||||
revealButton = RevealButtonState.REVEAL
|
||||
|
@ -270,16 +270,16 @@ class ViewThreadViewModelTest {
|
|||
|
||||
viewModel.changeExpanded(
|
||||
true,
|
||||
mockStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test")
|
||||
fakeStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test")
|
||||
)
|
||||
|
||||
runBlocking {
|
||||
assertEquals(
|
||||
ThreadUiState.Success(
|
||||
statusViewData = listOf(
|
||||
mockStatusViewData(id = "1", spoilerText = "Test"),
|
||||
mockStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test", isExpanded = true),
|
||||
mockStatusViewData(id = "3", inReplyToId = "2", inReplyToAccountId = "1", spoilerText = "Test")
|
||||
fakeStatusViewData(id = "1", spoilerText = "Test"),
|
||||
fakeStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test", isExpanded = true),
|
||||
fakeStatusViewData(id = "3", inReplyToId = "2", inReplyToAccountId = "1", spoilerText = "Test")
|
||||
),
|
||||
detailedStatusPosition = 1,
|
||||
revealButton = RevealButtonState.REVEAL
|
||||
|
@ -297,16 +297,16 @@ class ViewThreadViewModelTest {
|
|||
|
||||
viewModel.changeContentCollapsed(
|
||||
true,
|
||||
mockStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test")
|
||||
fakeStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test")
|
||||
)
|
||||
|
||||
runBlocking {
|
||||
assertEquals(
|
||||
ThreadUiState.Success(
|
||||
statusViewData = listOf(
|
||||
mockStatusViewData(id = "1", spoilerText = "Test"),
|
||||
mockStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test", isCollapsed = true),
|
||||
mockStatusViewData(id = "3", inReplyToId = "2", inReplyToAccountId = "1", spoilerText = "Test")
|
||||
fakeStatusViewData(id = "1", spoilerText = "Test"),
|
||||
fakeStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test", isCollapsed = true),
|
||||
fakeStatusViewData(id = "3", inReplyToId = "2", inReplyToAccountId = "1", spoilerText = "Test")
|
||||
),
|
||||
detailedStatusPosition = 1,
|
||||
revealButton = RevealButtonState.REVEAL
|
||||
|
@ -324,16 +324,16 @@ class ViewThreadViewModelTest {
|
|||
|
||||
viewModel.changeContentShowing(
|
||||
true,
|
||||
mockStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test")
|
||||
fakeStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test")
|
||||
)
|
||||
|
||||
runBlocking {
|
||||
assertEquals(
|
||||
ThreadUiState.Success(
|
||||
statusViewData = listOf(
|
||||
mockStatusViewData(id = "1", spoilerText = "Test"),
|
||||
mockStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test", isShowingContent = true),
|
||||
mockStatusViewData(id = "3", inReplyToId = "2", inReplyToAccountId = "1", spoilerText = "Test")
|
||||
fakeStatusViewData(id = "1", spoilerText = "Test"),
|
||||
fakeStatusViewData(id = "2", inReplyToId = "1", inReplyToAccountId = "1", isDetailed = true, spoilerText = "Test", isShowingContent = true),
|
||||
fakeStatusViewData(id = "3", inReplyToId = "2", inReplyToAccountId = "1", spoilerText = "Test")
|
||||
),
|
||||
detailedStatusPosition = 1,
|
||||
revealButton = RevealButtonState.REVEAL
|
||||
|
@ -345,11 +345,11 @@ class ViewThreadViewModelTest {
|
|||
|
||||
private fun mockSuccessResponses() {
|
||||
api.stub {
|
||||
onBlocking { status(threadId) } doReturn NetworkResult.success(mockStatus(id = "2", inReplyToId = "1", inReplyToAccountId = "1", spoilerText = "Test"))
|
||||
onBlocking { status(threadId) } doReturn NetworkResult.success(fakeStatus(id = "2", inReplyToId = "1", inReplyToAccountId = "1", spoilerText = "Test"))
|
||||
onBlocking { statusContext(threadId) } doReturn NetworkResult.success(
|
||||
StatusContext(
|
||||
ancestors = listOf(mockStatus(id = "1", spoilerText = "Test")),
|
||||
descendants = listOf(mockStatus(id = "3", inReplyToId = "2", inReplyToAccountId = "1", spoilerText = "Test"))
|
||||
ancestors = listOf(fakeStatus(id = "1", spoilerText = "Test")),
|
||||
descendants = listOf(fakeStatus(id = "3", inReplyToId = "2", inReplyToAccountId = "1", spoilerText = "Test"))
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -3,13 +3,13 @@ package com.keylesspalace.tusky.db.dao
|
|||
import androidx.room.Room
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.keylesspalace.tusky.components.notifications.fakeNotification
|
||||
import com.keylesspalace.tusky.components.notifications.fakeReport
|
||||
import com.keylesspalace.tusky.components.notifications.insert
|
||||
import com.keylesspalace.tusky.components.notifications.mockNotification
|
||||
import com.keylesspalace.tusky.components.notifications.mockReport
|
||||
import com.keylesspalace.tusky.components.timeline.fakeAccount
|
||||
import com.keylesspalace.tusky.components.timeline.fakeHomeTimelineData
|
||||
import com.keylesspalace.tusky.components.timeline.fakeStatus
|
||||
import com.keylesspalace.tusky.components.timeline.insert
|
||||
import com.keylesspalace.tusky.components.timeline.mockAccount
|
||||
import com.keylesspalace.tusky.components.timeline.mockHomeTimelineData
|
||||
import com.keylesspalace.tusky.components.timeline.mockStatus
|
||||
import com.keylesspalace.tusky.db.AppDatabase
|
||||
import com.keylesspalace.tusky.db.Converters
|
||||
import com.keylesspalace.tusky.db.entity.HomeTimelineEntity
|
||||
|
@ -156,38 +156,38 @@ class CleanupDaoTest {
|
|||
private suspend fun fillDatabase() {
|
||||
db.insert(
|
||||
listOf(
|
||||
mockHomeTimelineData(id = "100", authorServerId = "100"),
|
||||
mockHomeTimelineData(id = "10", authorServerId = "3"),
|
||||
mockHomeTimelineData(id = "8", reblogAuthorServerId = "R10", authorServerId = "10"),
|
||||
mockHomeTimelineData(id = "5", authorServerId = "100"),
|
||||
mockHomeTimelineData(id = "3", authorServerId = "4"),
|
||||
mockHomeTimelineData(id = "1", authorServerId = "5")
|
||||
fakeHomeTimelineData(id = "100", authorServerId = "100"),
|
||||
fakeHomeTimelineData(id = "10", authorServerId = "3"),
|
||||
fakeHomeTimelineData(id = "8", reblogAuthorServerId = "R10", authorServerId = "10"),
|
||||
fakeHomeTimelineData(id = "5", authorServerId = "100"),
|
||||
fakeHomeTimelineData(id = "3", authorServerId = "4"),
|
||||
fakeHomeTimelineData(id = "1", authorServerId = "5")
|
||||
),
|
||||
tuskyAccountId = 1
|
||||
)
|
||||
db.insert(
|
||||
listOf(
|
||||
mockHomeTimelineData(id = "2", tuskyAccountId = 2, authorServerId = "5")
|
||||
fakeHomeTimelineData(id = "2", tuskyAccountId = 2, authorServerId = "5")
|
||||
),
|
||||
tuskyAccountId = 2
|
||||
)
|
||||
|
||||
db.insert(
|
||||
listOf(
|
||||
mockNotification(id = "1", account = mockAccount(id = "n1"), status = mockStatus(id = "n1")),
|
||||
mockNotification(id = "2", account = mockAccount(id = "n2"), status = mockStatus(id = "n2"), report = mockReport(targetAccount = mockAccount(id = "r1"))),
|
||||
mockNotification(id = "3", account = mockAccount(id = "n3"), status = mockStatus(id = "n3")),
|
||||
mockNotification(id = "4", account = mockAccount(id = "n4"), status = mockStatus(id = "n4"), report = mockReport(id = "2", targetAccount = mockAccount(id = "r2"))),
|
||||
mockNotification(id = "5", account = mockAccount(id = "n5"), status = mockStatus(id = "n5")),
|
||||
fakeNotification(id = "1", account = fakeAccount(id = "n1"), status = fakeStatus(id = "n1")),
|
||||
fakeNotification(id = "2", account = fakeAccount(id = "n2"), status = fakeStatus(id = "n2"), report = fakeReport(targetAccount = fakeAccount(id = "r1"))),
|
||||
fakeNotification(id = "3", account = fakeAccount(id = "n3"), status = fakeStatus(id = "n3")),
|
||||
fakeNotification(id = "4", account = fakeAccount(id = "n4"), status = fakeStatus(id = "n4"), report = fakeReport(id = "2", targetAccount = fakeAccount(id = "r2"))),
|
||||
fakeNotification(id = "5", account = fakeAccount(id = "n5"), status = fakeStatus(id = "n5")),
|
||||
),
|
||||
tuskyAccountId = 1
|
||||
)
|
||||
db.insert(
|
||||
listOf(
|
||||
mockNotification(id = "1", account = mockAccount(id = "n1"), status = mockStatus(id = "n1")),
|
||||
mockNotification(id = "2", account = mockAccount(id = "n2"), status = mockStatus(id = "n2")),
|
||||
mockNotification(id = "3", account = mockAccount(id = "n3"), status = mockStatus(id = "n3")),
|
||||
mockNotification(id = "4", account = mockAccount(id = "n4"), status = mockStatus(id = "n4"), report = mockReport(targetAccount = mockAccount(id = "r1")))
|
||||
fakeNotification(id = "1", account = fakeAccount(id = "n1"), status = fakeStatus(id = "n1")),
|
||||
fakeNotification(id = "2", account = fakeAccount(id = "n2"), status = fakeStatus(id = "n2")),
|
||||
fakeNotification(id = "3", account = fakeAccount(id = "n3"), status = fakeStatus(id = "n3")),
|
||||
fakeNotification(id = "4", account = fakeAccount(id = "n4"), status = fakeStatus(id = "n4"), report = fakeReport(targetAccount = fakeAccount(id = "r1")))
|
||||
),
|
||||
tuskyAccountId = 2
|
||||
)
|
||||
|
|
|
@ -4,14 +4,14 @@ import androidx.paging.PagingSource
|
|||
import androidx.room.Room
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.keylesspalace.tusky.components.notifications.fakeNotification
|
||||
import com.keylesspalace.tusky.components.notifications.fakeReport
|
||||
import com.keylesspalace.tusky.components.notifications.insert
|
||||
import com.keylesspalace.tusky.components.notifications.mockNotification
|
||||
import com.keylesspalace.tusky.components.notifications.mockReport
|
||||
import com.keylesspalace.tusky.components.notifications.toNotificationDataEntity
|
||||
import com.keylesspalace.tusky.components.notifications.toNotificationEntity
|
||||
import com.keylesspalace.tusky.components.timeline.Placeholder
|
||||
import com.keylesspalace.tusky.components.timeline.mockAccount
|
||||
import com.keylesspalace.tusky.components.timeline.mockStatus
|
||||
import com.keylesspalace.tusky.components.timeline.fakeAccount
|
||||
import com.keylesspalace.tusky.components.timeline.fakeStatus
|
||||
import com.keylesspalace.tusky.db.AppDatabase
|
||||
import com.keylesspalace.tusky.db.Converters
|
||||
import com.keylesspalace.tusky.di.NetworkModule
|
||||
|
@ -52,14 +52,14 @@ class NotificationsDaoTest {
|
|||
fun insertAndGetNotification() = runTest {
|
||||
db.insert(
|
||||
listOf(
|
||||
mockNotification(id = "1"),
|
||||
mockNotification(id = "2"),
|
||||
mockNotification(id = "3"),
|
||||
fakeNotification(id = "1"),
|
||||
fakeNotification(id = "2"),
|
||||
fakeNotification(id = "3"),
|
||||
),
|
||||
tuskyAccountId = 1
|
||||
)
|
||||
db.insert(
|
||||
listOf(mockNotification(id = "3")),
|
||||
listOf(fakeNotification(id = "3")),
|
||||
tuskyAccountId = 2
|
||||
)
|
||||
|
||||
|
@ -71,8 +71,8 @@ class NotificationsDaoTest {
|
|||
|
||||
assertEquals(
|
||||
listOf(
|
||||
mockNotification(id = "3").toNotificationDataEntity(1),
|
||||
mockNotification(id = "2").toNotificationDataEntity(1)
|
||||
fakeNotification(id = "3").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "2").toNotificationDataEntity(1)
|
||||
),
|
||||
loadedStatuses
|
||||
)
|
||||
|
@ -81,18 +81,18 @@ class NotificationsDaoTest {
|
|||
@Test
|
||||
fun deleteRange() = runTest {
|
||||
val notifications = listOf(
|
||||
mockNotification(id = "100"),
|
||||
mockNotification(id = "50"),
|
||||
mockNotification(id = "15"),
|
||||
mockNotification(id = "14"),
|
||||
mockNotification(id = "13"),
|
||||
mockNotification(id = "12"),
|
||||
mockNotification(id = "11"),
|
||||
mockNotification(id = "9")
|
||||
fakeNotification(id = "100"),
|
||||
fakeNotification(id = "50"),
|
||||
fakeNotification(id = "15"),
|
||||
fakeNotification(id = "14"),
|
||||
fakeNotification(id = "13"),
|
||||
fakeNotification(id = "12"),
|
||||
fakeNotification(id = "11"),
|
||||
fakeNotification(id = "9")
|
||||
)
|
||||
|
||||
db.insert(notifications, 1)
|
||||
db.insert(listOf(mockNotification(id = "13")), 2)
|
||||
db.insert(listOf(fakeNotification(id = "13")), 2)
|
||||
|
||||
assertEquals(3, notificationsDao.deleteRange(1, "12", "14"))
|
||||
assertEquals(0, notificationsDao.deleteRange(1, "80", "80"))
|
||||
|
@ -107,14 +107,14 @@ class NotificationsDaoTest {
|
|||
val notificationsAccount2 = (notificationsDao.getNotifications(2).load(loadParams) as PagingSource.LoadResult.Page).data
|
||||
|
||||
val remainingNotificationsAccount1 = listOf(
|
||||
mockNotification(id = "100").toNotificationDataEntity(1),
|
||||
mockNotification(id = "15").toNotificationDataEntity(1),
|
||||
mockNotification(id = "11").toNotificationDataEntity(1),
|
||||
mockNotification(id = "9").toNotificationDataEntity(1)
|
||||
fakeNotification(id = "100").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "15").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "11").toNotificationDataEntity(1),
|
||||
fakeNotification(id = "9").toNotificationDataEntity(1)
|
||||
)
|
||||
|
||||
val remainingNotificationsAccount2 = listOf(
|
||||
mockNotification(id = "13").toNotificationDataEntity(2)
|
||||
fakeNotification(id = "13").toNotificationDataEntity(2)
|
||||
)
|
||||
|
||||
assertEquals(remainingNotificationsAccount1, notificationsAccount1)
|
||||
|
@ -123,12 +123,12 @@ class NotificationsDaoTest {
|
|||
|
||||
@Test
|
||||
fun deleteAllForInstance() = runTest {
|
||||
val redAccount = mockNotification(id = "500", account = mockAccount(id = "500", domain = "mastodon.red"))
|
||||
val blueAccount = mockNotification(id = "501", account = mockAccount(id = "501", domain = "mastodon.blue"))
|
||||
val redStatus = mockNotification(id = "502", account = mockAccount(id = "502", domain = "mastodon.example"), status = mockStatus(id = "502", domain = "mastodon.red", authorServerId = "502a"))
|
||||
val blueStatus = mockNotification(id = "503", account = mockAccount(id = "503", domain = "mastodon.example"), status = mockStatus(id = "503", domain = "mastodon.blue", authorServerId = "503a"))
|
||||
val redAccount = fakeNotification(id = "500", account = fakeAccount(id = "500", domain = "mastodon.red"))
|
||||
val blueAccount = fakeNotification(id = "501", account = fakeAccount(id = "501", domain = "mastodon.blue"))
|
||||
val redStatus = fakeNotification(id = "502", account = fakeAccount(id = "502", domain = "mastodon.example"), status = fakeStatus(id = "502", domain = "mastodon.red", authorServerId = "502a"))
|
||||
val blueStatus = fakeNotification(id = "503", account = fakeAccount(id = "503", domain = "mastodon.example"), status = fakeStatus(id = "503", domain = "mastodon.blue", authorServerId = "503a"))
|
||||
|
||||
val redStatus2 = mockNotification(id = "600", account = mockAccount(id = "600", domain = "mastodon.red"))
|
||||
val redStatus2 = fakeNotification(id = "600", account = fakeAccount(id = "600", domain = "mastodon.red"))
|
||||
|
||||
db.insert(listOf(redAccount, blueAccount, redStatus, blueStatus), 1)
|
||||
db.insert(listOf(redStatus2), 2)
|
||||
|
@ -161,18 +161,18 @@ class NotificationsDaoTest {
|
|||
fun `should return correct topId`() = runTest {
|
||||
db.insert(
|
||||
listOf(
|
||||
mockNotification(id = "100"),
|
||||
mockNotification(id = "3"),
|
||||
mockNotification(id = "33"),
|
||||
mockNotification(id = "8"),
|
||||
fakeNotification(id = "100"),
|
||||
fakeNotification(id = "3"),
|
||||
fakeNotification(id = "33"),
|
||||
fakeNotification(id = "8"),
|
||||
),
|
||||
tuskyAccountId = 1
|
||||
)
|
||||
db.insert(
|
||||
listOf(
|
||||
mockNotification(id = "200"),
|
||||
mockNotification(id = "300"),
|
||||
mockNotification(id = "1000"),
|
||||
fakeNotification(id = "200"),
|
||||
fakeNotification(id = "300"),
|
||||
fakeNotification(id = "1000"),
|
||||
),
|
||||
tuskyAccountId = 2
|
||||
)
|
||||
|
@ -184,10 +184,10 @@ class NotificationsDaoTest {
|
|||
@Test
|
||||
fun `should return correct top placeholderId`() = runTest {
|
||||
val notifications = listOf(
|
||||
mockNotification(id = "1000"),
|
||||
mockNotification(id = "97"),
|
||||
mockNotification(id = "90"),
|
||||
mockNotification(id = "77")
|
||||
fakeNotification(id = "1000"),
|
||||
fakeNotification(id = "97"),
|
||||
fakeNotification(id = "90"),
|
||||
fakeNotification(id = "77")
|
||||
)
|
||||
db.insert(notifications)
|
||||
|
||||
|
@ -202,18 +202,18 @@ class NotificationsDaoTest {
|
|||
fun `should correctly delete all by user`() = runTest {
|
||||
val notificationsAccount1 = listOf(
|
||||
// will be removed because it is a like by account 1
|
||||
mockNotification(id = "1", account = mockAccount(id = "1"), status = mockStatus(id = "1", authorServerId = "100")),
|
||||
fakeNotification(id = "1", account = fakeAccount(id = "1"), status = fakeStatus(id = "1", authorServerId = "100")),
|
||||
// will be removed because it references a status by account 1
|
||||
mockNotification(id = "2", account = mockAccount(id = "2"), status = mockStatus(id = "2", authorServerId = "1")),
|
||||
fakeNotification(id = "2", account = fakeAccount(id = "2"), status = fakeStatus(id = "2", authorServerId = "1")),
|
||||
// will not be removed because they are admin notifications
|
||||
mockNotification(type = Notification.Type.REPORT, id = "3", account = mockAccount(id = "3"), status = null, report = mockReport(id = "1", targetAccount = mockAccount(id = "1"))),
|
||||
mockNotification(type = Notification.Type.SIGN_UP, id = "4", account = mockAccount(id = "1"), status = null, report = mockReport(id = "1", targetAccount = mockAccount(id = "4"))),
|
||||
fakeNotification(type = Notification.Type.REPORT, id = "3", account = fakeAccount(id = "3"), status = null, report = fakeReport(id = "1", targetAccount = fakeAccount(id = "1"))),
|
||||
fakeNotification(type = Notification.Type.SIGN_UP, id = "4", account = fakeAccount(id = "1"), status = null, report = fakeReport(id = "1", targetAccount = fakeAccount(id = "4"))),
|
||||
// will not be removed because it does not reference account 1
|
||||
mockNotification(id = "5", account = mockAccount(id = "5"), status = mockStatus(id = "5", authorServerId = "100")),
|
||||
fakeNotification(id = "5", account = fakeAccount(id = "5"), status = fakeStatus(id = "5", authorServerId = "100")),
|
||||
)
|
||||
|
||||
db.insert(notificationsAccount1, tuskyAccountId = 1)
|
||||
db.insert(listOf(mockNotification(id = "6")), tuskyAccountId = 2)
|
||||
db.insert(listOf(fakeNotification(id = "6")), tuskyAccountId = 2)
|
||||
|
||||
notificationsDao.removeAllByUser(1, "1")
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@ import androidx.paging.PagingSource
|
|||
import androidx.room.Room
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.keylesspalace.tusky.components.timeline.fakeHomeTimelineData
|
||||
import com.keylesspalace.tusky.components.timeline.fakePlaceholderHomeTimelineData
|
||||
import com.keylesspalace.tusky.components.timeline.insert
|
||||
import com.keylesspalace.tusky.components.timeline.mockHomeTimelineData
|
||||
import com.keylesspalace.tusky.components.timeline.mockPlaceholderHomeTimelineData
|
||||
import com.keylesspalace.tusky.db.AppDatabase
|
||||
import com.keylesspalace.tusky.db.Converters
|
||||
import com.keylesspalace.tusky.di.NetworkModule
|
||||
|
@ -44,10 +44,10 @@ class TimelineDaoTest {
|
|||
|
||||
@Test
|
||||
fun insertGetStatus() = runTest {
|
||||
val setOne = mockHomeTimelineData(id = "3")
|
||||
val setTwo = mockHomeTimelineData(id = "20", reblogAuthorServerId = "R1")
|
||||
val ignoredOne = mockHomeTimelineData(id = "1")
|
||||
val ignoredTwo = mockHomeTimelineData(id = "2", tuskyAccountId = 2)
|
||||
val setOne = fakeHomeTimelineData(id = "3")
|
||||
val setTwo = fakeHomeTimelineData(id = "20", reblogAuthorServerId = "R1")
|
||||
val ignoredOne = fakeHomeTimelineData(id = "1")
|
||||
val ignoredTwo = fakeHomeTimelineData(id = "2", tuskyAccountId = 2)
|
||||
|
||||
db.insert(
|
||||
listOf(setOne, setTwo, ignoredOne),
|
||||
|
@ -71,17 +71,17 @@ class TimelineDaoTest {
|
|||
@Test
|
||||
fun overwriteDeletedStatus() = runTest {
|
||||
val oldStatuses = listOf(
|
||||
mockHomeTimelineData(id = "3"),
|
||||
mockHomeTimelineData(id = "2"),
|
||||
mockHomeTimelineData(id = "1")
|
||||
fakeHomeTimelineData(id = "3"),
|
||||
fakeHomeTimelineData(id = "2"),
|
||||
fakeHomeTimelineData(id = "1")
|
||||
)
|
||||
|
||||
db.insert(oldStatuses, 1)
|
||||
|
||||
// status 2 gets deleted, newly loaded status contain only 1 + 3
|
||||
val newStatuses = listOf(
|
||||
mockHomeTimelineData(id = "3"),
|
||||
mockHomeTimelineData(id = "1")
|
||||
fakeHomeTimelineData(id = "3"),
|
||||
fakeHomeTimelineData(id = "1")
|
||||
)
|
||||
|
||||
val deletedCount = timelineDao.deleteRange(1, newStatuses.last().id, newStatuses.first().id)
|
||||
|
@ -102,15 +102,15 @@ class TimelineDaoTest {
|
|||
@Test
|
||||
fun deleteRange() = runTest {
|
||||
val statuses = listOf(
|
||||
mockHomeTimelineData(id = "100"),
|
||||
mockHomeTimelineData(id = "50"),
|
||||
mockHomeTimelineData(id = "15"),
|
||||
mockHomeTimelineData(id = "14"),
|
||||
mockHomeTimelineData(id = "13"),
|
||||
mockHomeTimelineData(id = "13", tuskyAccountId = 2),
|
||||
mockHomeTimelineData(id = "12"),
|
||||
mockHomeTimelineData(id = "11"),
|
||||
mockHomeTimelineData(id = "9")
|
||||
fakeHomeTimelineData(id = "100"),
|
||||
fakeHomeTimelineData(id = "50"),
|
||||
fakeHomeTimelineData(id = "15"),
|
||||
fakeHomeTimelineData(id = "14"),
|
||||
fakeHomeTimelineData(id = "13"),
|
||||
fakeHomeTimelineData(id = "13", tuskyAccountId = 2),
|
||||
fakeHomeTimelineData(id = "12"),
|
||||
fakeHomeTimelineData(id = "11"),
|
||||
fakeHomeTimelineData(id = "9")
|
||||
)
|
||||
|
||||
db.insert(statuses - statuses[5], 1)
|
||||
|
@ -129,14 +129,14 @@ class TimelineDaoTest {
|
|||
val statusesAccount2 = (timelineDao.getHomeTimeline(2).load(loadParams) as PagingSource.LoadResult.Page).data
|
||||
|
||||
val remainingStatusesAccount1 = listOf(
|
||||
mockHomeTimelineData(id = "100"),
|
||||
mockHomeTimelineData(id = "15"),
|
||||
mockHomeTimelineData(id = "11"),
|
||||
mockHomeTimelineData(id = "9")
|
||||
fakeHomeTimelineData(id = "100"),
|
||||
fakeHomeTimelineData(id = "15"),
|
||||
fakeHomeTimelineData(id = "11"),
|
||||
fakeHomeTimelineData(id = "9")
|
||||
)
|
||||
|
||||
val remainingStatusesAccount2 = listOf(
|
||||
mockHomeTimelineData(id = "13", tuskyAccountId = 2)
|
||||
fakeHomeTimelineData(id = "13", tuskyAccountId = 2)
|
||||
)
|
||||
|
||||
assertEquals(remainingStatusesAccount1, statusesAccount1)
|
||||
|
@ -145,37 +145,37 @@ class TimelineDaoTest {
|
|||
|
||||
@Test
|
||||
fun deleteAllForInstance() = runTest {
|
||||
val statusWithRedDomain1 = mockHomeTimelineData(
|
||||
val statusWithRedDomain1 = fakeHomeTimelineData(
|
||||
id = "15",
|
||||
tuskyAccountId = 1,
|
||||
domain = "mastodon.red",
|
||||
authorServerId = "1"
|
||||
)
|
||||
val statusWithRedDomain2 = mockHomeTimelineData(
|
||||
val statusWithRedDomain2 = fakeHomeTimelineData(
|
||||
id = "14",
|
||||
tuskyAccountId = 1,
|
||||
domain = "mastodon.red",
|
||||
authorServerId = "2"
|
||||
)
|
||||
val statusWithRedDomainOtherAccount = mockHomeTimelineData(
|
||||
val statusWithRedDomainOtherAccount = fakeHomeTimelineData(
|
||||
id = "12",
|
||||
tuskyAccountId = 2,
|
||||
domain = "mastodon.red",
|
||||
authorServerId = "2"
|
||||
)
|
||||
val statusWithBlueDomain = mockHomeTimelineData(
|
||||
val statusWithBlueDomain = fakeHomeTimelineData(
|
||||
id = "10",
|
||||
tuskyAccountId = 1,
|
||||
domain = "mastodon.blue",
|
||||
authorServerId = "4"
|
||||
)
|
||||
val statusWithBlueDomainOtherAccount = mockHomeTimelineData(
|
||||
val statusWithBlueDomainOtherAccount = fakeHomeTimelineData(
|
||||
id = "10",
|
||||
tuskyAccountId = 2,
|
||||
domain = "mastodon.blue",
|
||||
authorServerId = "5"
|
||||
)
|
||||
val statusWithGreenDomain = mockHomeTimelineData(
|
||||
val statusWithGreenDomain = fakeHomeTimelineData(
|
||||
id = "8",
|
||||
tuskyAccountId = 1,
|
||||
domain = "mastodon.green",
|
||||
|
@ -206,19 +206,19 @@ class TimelineDaoTest {
|
|||
@Test
|
||||
fun `should return correct topId`() = runTest {
|
||||
val statusData = listOf(
|
||||
mockHomeTimelineData(
|
||||
fakeHomeTimelineData(
|
||||
id = "4",
|
||||
tuskyAccountId = 1,
|
||||
domain = "mastodon.test",
|
||||
authorServerId = "1"
|
||||
),
|
||||
mockHomeTimelineData(
|
||||
fakeHomeTimelineData(
|
||||
id = "33",
|
||||
tuskyAccountId = 1,
|
||||
domain = "mastodon.test",
|
||||
authorServerId = "2"
|
||||
),
|
||||
mockHomeTimelineData(
|
||||
fakeHomeTimelineData(
|
||||
id = "22",
|
||||
tuskyAccountId = 1,
|
||||
domain = "mastodon.test",
|
||||
|
@ -234,13 +234,13 @@ class TimelineDaoTest {
|
|||
@Test
|
||||
fun `should return correct top placeholderId`() = runTest {
|
||||
val statusData = listOf(
|
||||
mockHomeTimelineData(id = "1000"),
|
||||
mockPlaceholderHomeTimelineData(id = "99"),
|
||||
mockHomeTimelineData(id = "97"),
|
||||
mockPlaceholderHomeTimelineData(id = "96"),
|
||||
mockHomeTimelineData(id = "90"),
|
||||
mockPlaceholderHomeTimelineData(id = "80"),
|
||||
mockHomeTimelineData(id = "77")
|
||||
fakeHomeTimelineData(id = "1000"),
|
||||
fakePlaceholderHomeTimelineData(id = "99"),
|
||||
fakeHomeTimelineData(id = "97"),
|
||||
fakePlaceholderHomeTimelineData(id = "96"),
|
||||
fakeHomeTimelineData(id = "90"),
|
||||
fakePlaceholderHomeTimelineData(id = "80"),
|
||||
fakeHomeTimelineData(id = "77")
|
||||
)
|
||||
|
||||
db.insert(statusData)
|
||||
|
@ -252,25 +252,25 @@ class TimelineDaoTest {
|
|||
fun `should correctly delete all by user`() = runTest {
|
||||
val statusData = listOf(
|
||||
// will be deleted because it is a direct post
|
||||
mockHomeTimelineData(id = "0", tuskyAccountId = 1, authorServerId = "1"),
|
||||
fakeHomeTimelineData(id = "0", tuskyAccountId = 1, authorServerId = "1"),
|
||||
// different Tusky Account
|
||||
mockHomeTimelineData(id = "1", tuskyAccountId = 2, authorServerId = "1"),
|
||||
fakeHomeTimelineData(id = "1", tuskyAccountId = 2, authorServerId = "1"),
|
||||
// different author
|
||||
mockHomeTimelineData(id = "2", tuskyAccountId = 1, authorServerId = "2"),
|
||||
fakeHomeTimelineData(id = "2", tuskyAccountId = 1, authorServerId = "2"),
|
||||
// different author and reblogger
|
||||
mockHomeTimelineData(id = "3", tuskyAccountId = 1, authorServerId = "2", statusId = "100", reblogAuthorServerId = "3"),
|
||||
fakeHomeTimelineData(id = "3", tuskyAccountId = 1, authorServerId = "2", statusId = "100", reblogAuthorServerId = "3"),
|
||||
// will be deleted because it is a reblog
|
||||
mockHomeTimelineData(id = "4", tuskyAccountId = 1, authorServerId = "2", statusId = "101", reblogAuthorServerId = "1"),
|
||||
fakeHomeTimelineData(id = "4", tuskyAccountId = 1, authorServerId = "2", statusId = "101", reblogAuthorServerId = "1"),
|
||||
// not a status
|
||||
mockPlaceholderHomeTimelineData(id = "5"),
|
||||
fakePlaceholderHomeTimelineData(id = "5"),
|
||||
// will be deleted because it is a self reblog
|
||||
mockHomeTimelineData(id = "6", tuskyAccountId = 1, authorServerId = "1", statusId = "102", reblogAuthorServerId = "1"),
|
||||
fakeHomeTimelineData(id = "6", tuskyAccountId = 1, authorServerId = "1", statusId = "102", reblogAuthorServerId = "1"),
|
||||
// will be deleted because it direct post reblogged by another user
|
||||
mockHomeTimelineData(id = "7", tuskyAccountId = 1, authorServerId = "1", statusId = "103", reblogAuthorServerId = "3"),
|
||||
fakeHomeTimelineData(id = "7", tuskyAccountId = 1, authorServerId = "1", statusId = "103", reblogAuthorServerId = "3"),
|
||||
// different Tusky Account
|
||||
mockHomeTimelineData(id = "8", tuskyAccountId = 2, authorServerId = "3", statusId = "104", reblogAuthorServerId = "2"),
|
||||
fakeHomeTimelineData(id = "8", tuskyAccountId = 2, authorServerId = "3", statusId = "104", reblogAuthorServerId = "2"),
|
||||
// different Tusky Account
|
||||
mockHomeTimelineData(id = "9", tuskyAccountId = 2, authorServerId = "3", statusId = "105", reblogAuthorServerId = "1"),
|
||||
fakeHomeTimelineData(id = "9", tuskyAccountId = 2, authorServerId = "3", statusId = "105", reblogAuthorServerId = "1"),
|
||||
)
|
||||
|
||||
db.insert(statusData - statusData[1] - statusData[8] - statusData [9], tuskyAccountId = 1)
|
||||
|
@ -297,25 +297,25 @@ class TimelineDaoTest {
|
|||
fun `should correctly delete statuses and reblogs by user`() = runTest {
|
||||
val statusData = listOf(
|
||||
// will be deleted because it is a direct post
|
||||
mockHomeTimelineData(id = "0", tuskyAccountId = 1, authorServerId = "1"),
|
||||
fakeHomeTimelineData(id = "0", tuskyAccountId = 1, authorServerId = "1"),
|
||||
// different Tusky Account
|
||||
mockHomeTimelineData(id = "1", tuskyAccountId = 2, authorServerId = "1"),
|
||||
fakeHomeTimelineData(id = "1", tuskyAccountId = 2, authorServerId = "1"),
|
||||
// different author
|
||||
mockHomeTimelineData(id = "2", tuskyAccountId = 1, authorServerId = "2"),
|
||||
fakeHomeTimelineData(id = "2", tuskyAccountId = 1, authorServerId = "2"),
|
||||
// different author and reblogger
|
||||
mockHomeTimelineData(id = "3", tuskyAccountId = 1, authorServerId = "2", statusId = "100", reblogAuthorServerId = "3"),
|
||||
fakeHomeTimelineData(id = "3", tuskyAccountId = 1, authorServerId = "2", statusId = "100", reblogAuthorServerId = "3"),
|
||||
// will be deleted because it is a reblog
|
||||
mockHomeTimelineData(id = "4", tuskyAccountId = 1, authorServerId = "2", statusId = "101", reblogAuthorServerId = "1"),
|
||||
fakeHomeTimelineData(id = "4", tuskyAccountId = 1, authorServerId = "2", statusId = "101", reblogAuthorServerId = "1"),
|
||||
// not a status
|
||||
mockPlaceholderHomeTimelineData(id = "5"),
|
||||
fakePlaceholderHomeTimelineData(id = "5"),
|
||||
// will be deleted because it is a self reblog
|
||||
mockHomeTimelineData(id = "6", tuskyAccountId = 1, authorServerId = "1", statusId = "102", reblogAuthorServerId = "1"),
|
||||
fakeHomeTimelineData(id = "6", tuskyAccountId = 1, authorServerId = "1", statusId = "102", reblogAuthorServerId = "1"),
|
||||
// will NOT be deleted because it direct post reblogged by another user
|
||||
mockHomeTimelineData(id = "7", tuskyAccountId = 1, authorServerId = "1", statusId = "103", reblogAuthorServerId = "3"),
|
||||
fakeHomeTimelineData(id = "7", tuskyAccountId = 1, authorServerId = "1", statusId = "103", reblogAuthorServerId = "3"),
|
||||
// different Tusky Account
|
||||
mockHomeTimelineData(id = "8", tuskyAccountId = 2, authorServerId = "3", statusId = "104", reblogAuthorServerId = "2"),
|
||||
fakeHomeTimelineData(id = "8", tuskyAccountId = 2, authorServerId = "3", statusId = "104", reblogAuthorServerId = "2"),
|
||||
// different Tusky Account
|
||||
mockHomeTimelineData(id = "9", tuskyAccountId = 2, authorServerId = "3", statusId = "105", reblogAuthorServerId = "1"),
|
||||
fakeHomeTimelineData(id = "9", tuskyAccountId = 2, authorServerId = "3", statusId = "105", reblogAuthorServerId = "1"),
|
||||
)
|
||||
|
||||
db.insert(statusData - statusData[1] - statusData[8] - statusData [9], tuskyAccountId = 1)
|
||||
|
|
Loading…
Reference in New Issue