[MatrixSDK] make tests passes
This commit is contained in:
parent
38dc36e7bf
commit
dc8cfcdb8e
5 changed files with 10 additions and 6 deletions
|
|
@ -18,7 +18,6 @@ package io.element.android.libraries.matrix.api.auth
|
|||
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import org.junit.Test
|
||||
import org.matrix.rustcomponents.sdk.AuthenticationException
|
||||
|
||||
class AuthErrorCodeTests {
|
||||
|
||||
|
|
|
|||
|
|
@ -60,8 +60,13 @@ class FakeAuthenticationService : MatrixAuthenticationService {
|
|||
|
||||
override suspend fun login(username: String, password: String): Result<SessionId> {
|
||||
delay(100)
|
||||
loginError?.let { throw it }
|
||||
return Result.success(A_USER_ID)
|
||||
return loginError.let { loginError ->
|
||||
if (loginError == null) {
|
||||
Result.success(A_USER_ID)
|
||||
} else {
|
||||
Result.failure(loginError)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun givenLoginError(throwable: Throwable?) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue