WIP on count impl; reworking comparisons
This commit is contained in:
47
src/integration-test/kotlin/postgresql/CountIT.kt
Normal file
47
src/integration-test/kotlin/postgresql/CountIT.kt
Normal file
@@ -0,0 +1,47 @@
|
||||
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)
|
||||
}
|
||||
@@ -19,4 +19,14 @@ class DefinitionIT {
|
||||
@DisplayName("ensureFieldIndex creates an index")
|
||||
fun ensureFieldIndex() =
|
||||
PgDB().use(Definition::ensureFieldIndex)
|
||||
|
||||
@Test
|
||||
@DisplayName("ensureDocumentIndex creates a full index")
|
||||
fun ensureDocumentIndexFull() =
|
||||
PgDB().use(Definition::ensureDocumentIndexFull)
|
||||
|
||||
@Test
|
||||
@DisplayName("ensureDocumentIndex creates an optimized index")
|
||||
fun ensureDocumentIndexOptimized() =
|
||||
PgDB().use(Definition::ensureDocumentIndexOptimized)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user