android10 / Android-CleanArchitecture-Kotlin

This is a movies sample app in Kotlin, which is part of a serie of blog posts I have written about architecting android application using different approaches.
https://fernandocejas.com/2018/05/07/architecting-android-reloaded/
4.69k stars 935 forks source link

Navigator tests pass even if the destination Activity changes #38

Open cesarferreira opened 6 years ago

cesarferreira commented 6 years ago

Regarding NavigatorTest:

@Test fun `should forward user to movies screen`() {
  whenever(authenticator.userLoggedIn()).thenReturn(true)

  navigator.showMain(activityContext())

  verify(authenticator).userLoggedIn()
  RouteActivity::class shouldNavigateTo MoviesActivity::class
}

if you switch MoviesActivity with LoginActivity the test still passes

albodelu commented 6 years ago

Remove the = in this line and fix the hidden errors.

albodelu commented 6 years ago

This is a workaround that works but I did it half a year ago, and I would appreciate a better solution.