How do I write an android JUnit test when my activity relies on extras passed through an Intent?
问题 I am writing an android Junit test for a class that relies on extras passed to it through an Intent. I was able to get the class working properly, but I would still like to know how to write a unit test for such a class, as the test still fails. public class AddClassEvent extends Activity{ private String eventType; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle extras = getIntent().getExtras(); final String cNo = extras.getString(