mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-26 17:43:11 +01:00
avoiding shadowed lambda parameters
This commit is contained in:
parent
5df2ae9ae2
commit
d514751ffd
@ -28,15 +28,15 @@ class FakeRegisterActionHandler {
|
|||||||
val instance = mockk<RegistrationActionHandler>()
|
val instance = mockk<RegistrationActionHandler>()
|
||||||
|
|
||||||
fun givenResultFor(wizard: RegistrationWizard, action: RegisterAction, result: RegistrationResult) {
|
fun givenResultFor(wizard: RegistrationWizard, action: RegisterAction, result: RegistrationResult) {
|
||||||
coEvery { instance.handleRegisterAction(wizard, action) } answers {
|
coEvery { instance.handleRegisterAction(wizard, action) } answers { call ->
|
||||||
it.invocation.args.first()
|
call.invocation.args.first()
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun givenResultsFor(wizard: RegistrationWizard, result: List<Pair<RegisterAction, RegistrationResult>>) {
|
fun givenResultsFor(wizard: RegistrationWizard, result: List<Pair<RegisterAction, RegistrationResult>>) {
|
||||||
coEvery { instance.handleRegisterAction(wizard, any()) } answers {
|
coEvery { instance.handleRegisterAction(wizard, any()) } answers { call ->
|
||||||
val actionArg = it.invocation.args[1] as RegisterAction
|
val actionArg = call.invocation.args[1] as RegisterAction
|
||||||
result.first { it.first == actionArg }.second
|
result.first { it.first == actionArg }.second
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user