mirror of
https://github.com/pachli/pachli-android.git
synced 2025-02-05 03:38:40 +01:00
refactor: Inject Gson in FakeDatabaseModule (#153)
This commit is contained in:
parent
f88599908b
commit
628b5a7db5
@ -36,10 +36,10 @@ import javax.inject.Singleton
|
||||
object FakeDatabaseModule {
|
||||
@Provides
|
||||
@Singleton
|
||||
fun providesDatabase(): AppDatabase {
|
||||
fun providesDatabase(gson: Gson): AppDatabase {
|
||||
val context = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
return Room.inMemoryDatabaseBuilder(context, AppDatabase::class.java)
|
||||
.addTypeConverter(Converters(Gson()))
|
||||
.addTypeConverter(Converters(gson))
|
||||
.allowMainThreadQueries()
|
||||
.build()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user