package solutions.bitbadger.documents.integration.sqlite import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.assertThrows import solutions.bitbadger.documents.common.DocumentException import solutions.bitbadger.documents.integration.common.Delete import kotlin.test.Test /** * SQLite integration tests for the `Delete` object / `deleteBy*` connection extension functions */ @DisplayName("SQLite - Delete") class DeleteIT { @Test @DisplayName("byId deletes a matching ID") fun byIdMatch() = SQLiteDB().use(Delete::byIdMatch) @Test @DisplayName("byId succeeds when no ID matches") fun byIdNoMatch() = SQLiteDB().use(Delete::byIdNoMatch) @Test @DisplayName("byFields deletes matching documents") fun byFieldsMatch() = SQLiteDB().use(Delete::byFieldsMatch) @Test @DisplayName("byFields succeeds when no documents match") fun byFieldsNoMatch() = SQLiteDB().use(Delete::byFieldsNoMatch) @Test @DisplayName("byContains fails") fun byContainsFails() { assertThrows { SQLiteDB().use(Delete::byContainsMatch) } } @Test @DisplayName("byJsonPath fails") fun byJsonPathFails() { assertThrows { SQLiteDB().use(Delete::byJsonPathMatch) } } }