-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
54 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
app-android/src/test/java/io/github/droidkaigi/confsched2023/FakeAppModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.github.droidkaigi.confsched2023 | ||
|
||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.components.SingletonComponent | ||
import dagger.hilt.testing.TestInstallIn | ||
import kotlinx.datetime.Clock | ||
import kotlinx.datetime.Instant | ||
import javax.inject.Singleton | ||
|
||
@TestInstallIn( | ||
components = [SingletonComponent::class], | ||
replaces = [AppModule::class], | ||
) | ||
@Module | ||
class FakeAppModule { | ||
@Provides | ||
@Singleton | ||
fun provideClockProvider(): ClockProvider = object : ClockProvider { | ||
override fun clock(): Clock = object : Clock { | ||
override fun now() = Instant.parse("2023-09-14T10:00:00.00Z") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters