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() } }