including verification to ensure no other methods are being called

This commit is contained in:
Adam Brown 2022-03-18 14:00:56 +00:00
parent 7f943d37fd
commit ce2c309d72

View file

@ -18,6 +18,7 @@ package im.vector.app.features.onboarding
import im.vector.app.test.fakes.FakeRegistrationWizard
import im.vector.app.test.fakes.FakeSession
import io.mockk.coVerifyAll
import kotlinx.coroutines.test.runBlockingTest
import org.amshove.kluent.shouldBeEqualTo
import org.junit.Test
@ -63,6 +64,7 @@ class RegistrationActionHandlerTest {
val result = registrationActionHandler.handleRegisterAction(fakeRegistrationWizard, case.action)
coVerifyAll { case.expect(fakeRegistrationWizard) }
result shouldBeEqualTo AN_EXPECTED_RESULT
}
}
@ -70,5 +72,3 @@ class RegistrationActionHandlerTest {
private fun case(action: RegisterAction, expect: suspend RegistrationWizard.() -> RegistrationResult) = Case(action, expect)
private class Case(val action: RegisterAction, val expect: suspend RegistrationWizard.() -> RegistrationResult)