49 lines
1.2 KiB
Kotlin

package solutions.bitbadger.documents.postgresql
import org.junit.jupiter.api.DisplayName
import solutions.bitbadger.documents.common.Custom
import kotlin.test.Test
/**
* PostgreSQL integration tests for the `Custom` object / `custom*` connection extension functions
*/
@DisplayName("PostgreSQL - Custom")
class CustomIT {
@Test
@DisplayName("list succeeds with empty list")
fun listEmpty() =
PgDB().use(Custom::listEmpty)
@Test
@DisplayName("list succeeds with a non-empty list")
fun listAll() =
PgDB().use(Custom::listAll)
@Test
@DisplayName("single succeeds when document not found")
fun singleNone() =
PgDB().use(Custom::singleNone)
@Test
@DisplayName("single succeeds when a document is found")
fun singleOne() =
PgDB().use(Custom::singleOne)
@Test
@DisplayName("nonQuery makes changes")
fun nonQueryChanges() =
PgDB().use(Custom::nonQueryChanges)
@Test
@DisplayName("nonQuery makes no changes when where clause matches nothing")
fun nonQueryNoChanges() =
PgDB().use(Custom::nonQueryNoChanges)
@Test
@DisplayName("scalar succeeds")
fun scalar() =
PgDB().use(Custom::scalar)
}