refactor: Inject Gson in FakeDatabaseModule (#153)

This commit is contained in:
Nik Clayton 2023-10-11 21:27:28 +02:00 committed by GitHub
parent f88599908b
commit 628b5a7db5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

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