Updated on 2026-08-14

This commit is contained in:
Tangem 2026-06-03 14:10:17 +04:00
parent 09c52231e2
commit 3cc0a643e9
40 changed files with 77 additions and 71 deletions

View file

@ -1,11 +0,0 @@
package com.tangem.common.test
import com.tangem.utils.coroutines.AppCoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.test.TestScope
import kotlin.coroutines.CoroutineContext
class TestAppCoroutineScope(override val coroutineContext: CoroutineContext = Dispatchers.Unconfined) : AppCoroutineScope {
constructor(testScope: TestScope) : this(testScope.coroutineContext)
}

View file

@ -1,16 +0,0 @@
package com.tangem.common.test.datastore
import androidx.datastore.core.DataStore
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.updateAndGet
class MockStateDataStore<T>(default: T) : DataStore<T> {
private val _data = MutableStateFlow(value = default)
override val data: Flow<T> = _data
override suspend fun updateData(transform: suspend (t: T) -> T): T {
return _data.updateAndGet { transform(it) }
}
}