Skip to content

Instantly share code, notes, and snippets.

@trietbui85
Last active July 29, 2020 13:42
Show Gist options
  • Save trietbui85/dd7dbf871595b26bfa65e453c8a37d04 to your computer and use it in GitHub Desktop.
Save trietbui85/dd7dbf871595b26bfa65e453c8a37d04 to your computer and use it in GitHub Desktop.
Unit test Android custom view with AndroidX Test and Robolectric
@Test
fun testUiOfButtonAdd() {
assertThat(buttonAdd.isEnabled).isTrue()
assertThat(buttonAdd.visibility).isEqualTo(View.VISIBLE)
assertThat(buttonAdd.text).isEqualTo(context.getString(R.string.button_add))
assertThat(buttonAdd.textSize).isEqualTo(context.resources.getDimension(R.dimen.count_text_size))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment