Skip to content

Instantly share code, notes, and snippets.

@nongdenchet
Created November 25, 2019 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nongdenchet/a53aa0d962991a4f6dd243ca50bba818 to your computer and use it in GitHub Desktop.
Save nongdenchet/a53aa0d962991a4f6dd243ca50bba818 to your computer and use it in GitHub Desktop.
RemyndDetailsFragmentTest#testCreateNewRemind
@Test
fun testCreateNewRemind() {
mockData()
launchFragmentInContainer<RemyndDetailsFragment>(
factory = factory,
themeResId = R.style.AppTheme
)
onView(withId(R.id.edtTitle)).perform(
typeText("Go to school"),
closeSoftKeyboard()
)
onView(withId(R.id.tvSave)).perform(click())
runBlocking {
val entity = remyndDao.get(2)!!
assertEquals("Go to school", entity.content)
assertTrue(entity.active)
verify(scheduler, times(1)).schedule(
Alarm(
id = 2,
content = "Go to school",
triggerAt = entity.triggerAt,
vibrate = false,
interval = null
)
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment