mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 18:35:40 +03:00
avoiding shadowed lambda parameters
This commit is contained in:
parent
5df2ae9ae2
commit
d514751ffd
1 changed files with 4 additions and 4 deletions
|
@ -28,15 +28,15 @@ class FakeRegisterActionHandler {
|
|||
val instance = mockk<RegistrationActionHandler>()
|
||||
|
||||
fun givenResultFor(wizard: RegistrationWizard, action: RegisterAction, result: RegistrationResult) {
|
||||
coEvery { instance.handleRegisterAction(wizard, action) } answers {
|
||||
it.invocation.args.first()
|
||||
coEvery { instance.handleRegisterAction(wizard, action) } answers { call ->
|
||||
call.invocation.args.first()
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
fun givenResultsFor(wizard: RegistrationWizard, result: List<Pair<RegisterAction, RegistrationResult>>) {
|
||||
coEvery { instance.handleRegisterAction(wizard, any()) } answers {
|
||||
val actionArg = it.invocation.args[1] as RegisterAction
|
||||
coEvery { instance.handleRegisterAction(wizard, any()) } answers { call ->
|
||||
val actionArg = call.invocation.args[1] as RegisterAction
|
||||
result.first { it.first == actionArg }.second
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue