Skip to content

Instantly share code, notes, and snippets.

@phellipealexandre
Last active December 19, 2019 01:03
Show Gist options
  • Save phellipealexandre/7f29241ce634296ae6c22b99adc7cd80 to your computer and use it in GitHub Desktop.
Save phellipealexandre/7f29241ce634296ae6c22b99adc7cd80 to your computer and use it in GitHub Desktop.
import androidx.test.core.app.ApplicationProvider
@RunWith(AndroidJUnit4::class)
class DatabaseTest {
private lateinit var database: MainDatabase
@Before
fun setUp() {
val context = ApplicationProvider.getApplicationContext<Context>()
database = Room.inMemoryDatabaseBuilder(context, MainDatabase::class.java).build()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment