Android Test - Call Method

Asked

Viewed 60 times

2

I wonder if in android Unit test would have the possibility to call isolated methods of code, or if only calling activitys, buttons... I searched several places and found nothing talking about

  • Gomes, it seems that you searched in wrong places, because in the official Android documentation, there is a topic talking about it, look here, I believe it helps you.

1 answer

1


You have full access to all Activity methods whether implicitly or explicitly.

Type:

public void testNomeAplicacao() {
      TextView nomeAplicacao = (TextView) demo.findViewById(R.id.nomeAplicacao);
      assertEquals(nomeAplicacao.getText().toString(), "Helo World, EuAndroid");

}

More information here

Browser other questions tagged

You are not signed in. Login or sign up in order to post.