@Override public void setUp() throws Exception { super.setUp(); activity = this.getActivity(); tv1 = (TextView) activity.findViewById(R.id.tv1); btn1 = (Button) activity.findViewById(R.id.btn1); }
public void testUI() { activity.runOnUiThread( new Runnable() { @Override public void run() { btn1.performClick(); assertEquals(tv1.getText().toString(), "clickBtn1"); } }); getInstrumentation().waitForIdleSync(); }
public void testSay() { assertEquals("Hello", activity.say()); }