From 628b5a7db57eff5c44d9be763035b8b7230be3b5 Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Wed, 11 Oct 2023 21:27:28 +0200 Subject: [PATCH] refactor: Inject Gson in FakeDatabaseModule (#153) --- app/src/test/java/app/pachli/di/FakeDatabaseModule.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/test/java/app/pachli/di/FakeDatabaseModule.kt b/app/src/test/java/app/pachli/di/FakeDatabaseModule.kt index 3659554a3..a3e6b175b 100644 --- a/app/src/test/java/app/pachli/di/FakeDatabaseModule.kt +++ b/app/src/test/java/app/pachli/di/FakeDatabaseModule.kt @@ -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() }