Created
December 17, 2019 09:11
-
-
Save mitrejcevski/4389bba710befc592026502012ab4488 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val loginModule = module { | |
val credentialsValidator = LoginCredentialsValidator() | |
val loginApi = InMemoryLoginApi() | |
val loginRepository = RemoteLoginRepository(loginApi) | |
viewModel { | |
LoginViewModel(credentialsValidator, loginRepository) | |
} | |
} | |
@Before | |
fun setUp() { | |
loadKoinModules(loginModule) | |
rule.launchActivity(Intent()) | |
} | |
@Test | |
fun should_display_incorrect_credentials_error() { | |
onView(withId(R.id.loginUsername)).perform(typeText("username")) | |
onView(withId(R.id.loginPassword)).perform(typeText("password")) | |
onView(withId(R.id.loginButton)).perform(click()) | |
onView(withId(R.id.textInfoLabel)).check(matches(withText("Incorrect Credentials"))) | |
} | |
@After | |
fun tearDown() { | |
unloadKoinModules(loginModule) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment