mirror of
https://github.com/msfjarvis/compose-lobsters.git
synced 2024-06-03 04:18:58 +05:30
31 lines
833 B
Kotlin
31 lines
833 B
Kotlin
/*
|
|
* Copyright © 2023 Harsh Shandilya.
|
|
* Use of this source code is governed by an MIT-style
|
|
* license that can be found in the LICENSE file or at
|
|
* https://opensource.org/licenses/MIT.
|
|
*/
|
|
package dev.msfjarvis.claw.database.local
|
|
|
|
import com.google.common.truth.Truth.assertThat
|
|
import java.util.UUID
|
|
import org.junit.jupiter.api.BeforeEach
|
|
import org.junit.jupiter.api.Test
|
|
|
|
class ReadPostsQueriesTest {
|
|
private lateinit var postQueries: ReadPostsQueries
|
|
|
|
@BeforeEach
|
|
fun setup() {
|
|
postQueries = setupDatabase().readPostsQueries
|
|
}
|
|
|
|
@Test
|
|
fun `mark post as read`() {
|
|
val id = UUID.randomUUID().toString()
|
|
postQueries.markRead(id)
|
|
assertThat(postQueries.isRead(id).executeAsOne()).isNotNull()
|
|
postQueries.markUnread(id)
|
|
assertThat(postQueries.isRead(id).executeAsOneOrNull()).isNull()
|
|
}
|
|
}
|