mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-10-08 00:40:25 +00:00
add tests for cruds
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package full
|
||||
|
||||
import CommonCRUDRepoTests
|
||||
import com.benasher44.uuid.uuid4
|
||||
import dev.inmo.micro_utils.repos.CRUDRepo
|
||||
import dev.inmo.micro_utils.repos.MapCRUDRepo
|
||||
import kotlinx.coroutines.test.TestResult
|
||||
import kotlin.test.*
|
||||
|
||||
class InMemoryCRUDRepoTests : CommonCRUDRepoTests() {
|
||||
override val repoCreator: suspend () -> CRUDRepo<Registered, String, New> = {
|
||||
MapCRUDRepo(
|
||||
{ new, id, old ->
|
||||
Registered(id, new.data)
|
||||
}
|
||||
) {
|
||||
val id = uuid4().toString()
|
||||
id to Registered(id, it.data)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
override fun creatingWorksProperly(): TestResult {
|
||||
return super.creatingWorksProperly()
|
||||
}
|
||||
|
||||
@Test
|
||||
override fun removingWorksProperly(): TestResult {
|
||||
return super.removingWorksProperly()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user