You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
poker-analytics/app/src/androidTest/java/net/pokeranalytics/android/RealmInstrumentedUnitTest.kt

33 lines
653 B

package net.pokeranalytics.android
import io.realm.Realm
import io.realm.RealmConfiguration
import org.junit.After
import org.junit.Before
open class RealmInstrumentedUnitTest {
lateinit var mockRealm: Realm
@Before
fun setup() {
val testConfig = RealmConfiguration.Builder().inMemory().name("test-realm").build()
Realm.setDefaultConfiguration(testConfig)
this.mockRealm = Realm.getDefaultInstance()
this.mockRealm.executeTransaction {
this.mockRealm.deleteAll()
}
}
@After
@Throws(Exception::class)
public fun tearDown() {
this.mockRealm.close()
}
}