Add test on DefaultFtueService.reset().

This commit is contained in:
Benoit Marty 2024-06-17 15:04:20 +02:00
parent 03a197e530
commit b68b08300a
3 changed files with 52 additions and 1 deletions

View file

@ -27,7 +27,8 @@ import kotlinx.coroutines.flow.MutableStateFlow
class FakeAnalyticsService(
isEnabled: Boolean = false,
didAskUserConsent: Boolean = false
didAskUserConsent: Boolean = false,
private val resetLambda: () -> Unit = {},
) : AnalyticsService {
private val isEnabledFlow = MutableStateFlow(isEnabled)
private val didAskUserConsentFlow = MutableStateFlow(didAskUserConsent)
@ -77,5 +78,6 @@ class FakeAnalyticsService(
override suspend fun reset() {
didAskUserConsentFlow.value = false
resetLambda()
}
}