Slide 76
Slide 76 text
Android.test
public class SimpleActivityTestStandard extends!
ActivityUnitTestCase {!
public SimpleActivityTestStandard() {!
super(SimpleActivity.class);!
}!
!
public void setUp() throws Exception {!
startActivity(new Intent(getInstrumentation().getTargetContext(),!
SimpleActivity.class), null, null);!
}!
!
! public void testLayout() {!
SimpleActivity activity = getActivity();!
assertNotNull(activity.findViewById(R.id.button1));!
Button view = (Button) activity!
.findViewById(com.example.test.target.R.id.button1);!
assertEquals("My Button 1", view.getText());!
}!
}