Add test for push distributor change.

This commit is contained in:
Benoit Marty
2024-05-17 18:10:12 +02:00
committed by Benoit Marty
parent 92d6b72b2a
commit ada777e45c
4 changed files with 102 additions and 7 deletions
@@ -25,7 +25,7 @@ class FakePushProvider(
override val index: Int = 0,
override val name: String = "aFakePushProvider",
private val isAvailable: Boolean = true,
private val distributors: List<Distributor> = emptyList()
private val distributors: List<Distributor> = listOf(Distributor("aDistributorValue", "aDistributorName")),
) : PushProvider {
override fun isAvailable(): Boolean = isAvailable
@@ -36,7 +36,7 @@ class FakePushProvider(
}
override suspend fun getCurrentDistributor(matrixClient: MatrixClient): Distributor? {
return null
return distributors.firstOrNull()
}
override suspend fun unregister(matrixClient: MatrixClient): Result<Unit> {