Reorg modules; complete impls/tests
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
package solutions.bitbadger.documents.kotlinx.tests.integration
|
||||
|
||||
import org.junit.jupiter.api.DisplayName
|
||||
import org.junit.jupiter.api.assertThrows
|
||||
import solutions.bitbadger.documents.DocumentException
|
||||
import kotlin.test.Test
|
||||
|
||||
/**
|
||||
* SQLite integration tests for the `RemoveFields` object / `removeFieldsBy*` connection extension functions
|
||||
*/
|
||||
@DisplayName("KotlinX | SQLite: RemoveFields")
|
||||
class SQLiteRemoveFieldsIT {
|
||||
|
||||
@Test
|
||||
@DisplayName("byId removes fields from an existing document")
|
||||
fun byIdMatchFields() =
|
||||
SQLiteDB().use(RemoveFieldsFunctions::byIdMatchFields)
|
||||
|
||||
@Test
|
||||
@DisplayName("byId succeeds when fields do not exist on an existing document")
|
||||
fun byIdMatchNoFields() =
|
||||
SQLiteDB().use(RemoveFieldsFunctions::byIdMatchNoFields)
|
||||
|
||||
@Test
|
||||
@DisplayName("byId succeeds when no document exists")
|
||||
fun byIdNoMatch() =
|
||||
SQLiteDB().use(RemoveFieldsFunctions::byIdNoMatch)
|
||||
|
||||
@Test
|
||||
@DisplayName("byFields removes fields from matching documents")
|
||||
fun byFieldsMatchFields() =
|
||||
SQLiteDB().use(RemoveFieldsFunctions::byFieldsMatchFields)
|
||||
|
||||
@Test
|
||||
@DisplayName("byFields succeeds when fields do not exist on matching documents")
|
||||
fun byFieldsMatchNoFields() =
|
||||
SQLiteDB().use(RemoveFieldsFunctions::byFieldsMatchNoFields)
|
||||
|
||||
@Test
|
||||
@DisplayName("byFields succeeds when no matching documents exist")
|
||||
fun byFieldsNoMatch() =
|
||||
SQLiteDB().use(RemoveFieldsFunctions::byFieldsNoMatch)
|
||||
|
||||
@Test
|
||||
@DisplayName("byContains fails")
|
||||
fun byContainsFails() {
|
||||
assertThrows<DocumentException> { SQLiteDB().use(RemoveFieldsFunctions::byContainsMatchFields) }
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("byJsonPath fails")
|
||||
fun byJsonPathFails() {
|
||||
assertThrows<DocumentException> { SQLiteDB().use(RemoveFieldsFunctions::byJsonPathMatchFields) }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user