48 lines
1.3 KiB
Kotlin
48 lines
1.3 KiB
Kotlin
package solutions.bitbadger.documents.postgresql
|
|
|
|
import org.junit.jupiter.api.DisplayName
|
|
import solutions.bitbadger.documents.common.Count
|
|
import kotlin.test.Test
|
|
|
|
/**
|
|
* PostgreSQL integration tests for the `Count` object / `count*` connection extension functions
|
|
*/
|
|
@DisplayName("PostgreSQL - Count")
|
|
class CountIT {
|
|
|
|
@Test
|
|
@DisplayName("all counts all documents")
|
|
fun all() =
|
|
PgDB().use(Count::all)
|
|
|
|
@Test
|
|
@DisplayName("byFields counts documents by a numeric value")
|
|
fun byFieldsNumeric() =
|
|
PgDB().use(Count::byFieldsNumeric)
|
|
|
|
@Test
|
|
@DisplayName("byFields counts documents by a alphanumeric value")
|
|
fun byFieldsAlpha() =
|
|
PgDB().use(Count::byFieldsAlpha)
|
|
|
|
@Test
|
|
@DisplayName("byContains counts documents when matches are found")
|
|
fun byContainsMatch() =
|
|
PgDB().use(Count::byContainsMatch)
|
|
|
|
@Test
|
|
@DisplayName("byContains counts documents when no matches are found")
|
|
fun byContainsNoMatch() =
|
|
PgDB().use(Count::byContainsNoMatch)
|
|
|
|
@Test
|
|
@DisplayName("byJsonPath counts documents when matches are found")
|
|
fun byJsonPathMatch() =
|
|
PgDB().use(Count::byJsonPathMatch)
|
|
|
|
@Test
|
|
@DisplayName("byJsonPath counts documents when no matches are found")
|
|
fun byJsonPathNoMatch() =
|
|
PgDB().use(Count::byJsonPathNoMatch)
|
|
}
|