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…
Reference in New Issue