This repository has been archived by the owner on Feb 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2aa70c
commit e09dba9
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
bridge-client/src/jvmTest/kotlin/org/sagebionetworks/bridge/kmm/shared/BaseTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.sagebionetworks.bridge.kmm.shared | ||
|
||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.runBlocking | ||
|
||
actual abstract class BaseTest actual constructor() { | ||
|
||
actual fun <T> runTest(block: suspend CoroutineScope.() -> T) { | ||
runBlocking { block() } | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
bridge-client/src/jvmTest/kotlin/org/sagebionetworks/bridge/kmm/shared/TestUtilsJvm.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.sagebionetworks.bridge.kmm.shared | ||
|
||
import app.cash.sqldelight.db.SqlDriver | ||
import app.cash.sqldelight.driver.jdbc.sqlite.JdbcSqliteDriver | ||
import org.sagebionetworks.bridge.kmm.shared.cache.BridgeResourceDatabase | ||
import java.util.UUID | ||
|
||
internal actual fun testDatabaseDriver(): SqlDriver { | ||
return JdbcSqliteDriver(JdbcSqliteDriver.IN_MEMORY).apply { | ||
BridgeResourceDatabase.Schema.create(this) | ||
} | ||
} | ||
|
||
internal actual fun randomUUID() = UUID.randomUUID().toString() |