mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Improve current push provider test: give info about the distributor.
This commit is contained in:
+6
@@ -17,7 +17,9 @@ import io.element.android.tests.testutils.lambda.lambdaError
|
||||
class FakePushProvider(
|
||||
override val index: Int = 0,
|
||||
override val name: String = "aFakePushProvider",
|
||||
override val supportMultipleDistributors: Boolean = false,
|
||||
private val distributors: List<Distributor> = listOf(Distributor("aDistributorValue", "aDistributorName")),
|
||||
private val currentDistributorValue: () -> String? = { lambdaError() },
|
||||
private val currentDistributor: () -> Distributor? = { distributors.firstOrNull() },
|
||||
private val currentUserPushConfig: CurrentUserPushConfig? = null,
|
||||
private val registerWithResult: (MatrixClient, Distributor) -> Result<Unit> = { _, _ -> lambdaError() },
|
||||
@@ -32,6 +34,10 @@ class FakePushProvider(
|
||||
return registerWithResult(matrixClient, distributor)
|
||||
}
|
||||
|
||||
override suspend fun getCurrentDistributorValue(sessionId: SessionId): String? {
|
||||
return currentDistributorValue()
|
||||
}
|
||||
|
||||
override suspend fun getCurrentDistributor(sessionId: SessionId): Distributor? {
|
||||
return currentDistributor()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user