Introduce lambdaError instead of using TODO, to handle error when a lambda is invoked and it should not.
This commit is contained in:
parent
955b4308ce
commit
4fc3c6f889
21 changed files with 77 additions and 33 deletions
|
|
@ -24,4 +24,5 @@ android {
|
|||
dependencies {
|
||||
implementation(projects.libraries.matrix.api)
|
||||
implementation(projects.libraries.pushproviders.api)
|
||||
implementation(projects.tests.testutils)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ class FakePushProvider(
|
|||
private val isAvailable: Boolean = true,
|
||||
private val distributors: List<Distributor> = listOf(Distributor("aDistributorValue", "aDistributorName")),
|
||||
private val currentUserPushConfig: CurrentUserPushConfig? = null,
|
||||
private val registerWithResult: (MatrixClient, Distributor) -> Result<Unit> = { _, _ -> TODO() },
|
||||
private val unregisterWithResult: (MatrixClient) -> Result<Unit> = { TODO() },
|
||||
private val registerWithResult: (MatrixClient, Distributor) -> Result<Unit> = { _, _ -> lambdaError() },
|
||||
private val unregisterWithResult: (MatrixClient) -> Result<Unit> = { lambdaError() },
|
||||
) : PushProvider {
|
||||
override fun isAvailable(): Boolean = isAvailable
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue