Add exists functions
This commit is contained in:
@@ -4,6 +4,9 @@ import org.junit.jupiter.api.DisplayName
|
||||
import solutions.bitbadger.documents.common.Delete
|
||||
import kotlin.test.Test
|
||||
|
||||
/**
|
||||
* PostgreSQL integration tests for the `Delete` object / `deleteBy*` connection extension functions
|
||||
*/
|
||||
@DisplayName("PostgreSQL - Delete")
|
||||
class DeleteIT {
|
||||
|
||||
|
||||
52
src/integration-test/kotlin/postgresql/ExistsIT.kt
Normal file
52
src/integration-test/kotlin/postgresql/ExistsIT.kt
Normal file
@@ -0,0 +1,52 @@
|
||||
package solutions.bitbadger.documents.postgresql
|
||||
|
||||
import org.junit.jupiter.api.DisplayName
|
||||
import solutions.bitbadger.documents.common.Exists
|
||||
import kotlin.test.Test
|
||||
|
||||
/**
|
||||
* PostgreSQL integration tests for the `Exists` object / `existsBy*` connection extension functions
|
||||
*/
|
||||
@DisplayName("PostgreSQL - Exists")
|
||||
class ExistsIT {
|
||||
|
||||
@Test
|
||||
@DisplayName("byId returns true when a document matches the ID")
|
||||
fun byIdMatch() =
|
||||
PgDB().use(Exists::byIdMatch)
|
||||
|
||||
@Test
|
||||
@DisplayName("byId returns false when no document matches the ID")
|
||||
fun byIdNoMatch() =
|
||||
PgDB().use(Exists::byIdNoMatch)
|
||||
|
||||
@Test
|
||||
@DisplayName("byFields returns true when documents match")
|
||||
fun byFieldsMatch() =
|
||||
PgDB().use(Exists::byFieldsMatch)
|
||||
|
||||
@Test
|
||||
@DisplayName("byFields returns false when no documents match")
|
||||
fun byFieldsNoMatch() =
|
||||
PgDB().use(Exists::byFieldsNoMatch)
|
||||
|
||||
@Test
|
||||
@DisplayName("byContains returns true when documents match")
|
||||
fun byContainsMatch() =
|
||||
PgDB().use(Exists::byContainsMatch)
|
||||
|
||||
@Test
|
||||
@DisplayName("byContains returns false when no documents match")
|
||||
fun byContainsNoMatch() =
|
||||
PgDB().use(Exists::byContainsNoMatch)
|
||||
|
||||
@Test
|
||||
@DisplayName("byJsonPath returns true when documents match")
|
||||
fun byJsonPathMatch() =
|
||||
PgDB().use(Exists::byJsonPathMatch)
|
||||
|
||||
@Test
|
||||
@DisplayName("byJsonPath returns false when no documents match")
|
||||
fun byJsonPathNoMatch() =
|
||||
PgDB().use(Exists::byJsonPathNoMatch)
|
||||
}
|
||||
Reference in New Issue
Block a user