dcarr622

MainActivityTest

Jan 24th, 2013
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. package com.example.dcarr1.test;
  2.  
  3. import android.test.ActivityInstrumentationTestCase2;
  4. import com.example.dcarr1.MainActivity;
  5.  
  6. public class MainActivityTest extends
  7. ActivityInstrumentationTestCase2<MainActivity> {
  8.  
  9. private MainActivity mActivity;
  10.  
  11. public MainActivityTest(String name) {
  12. super(MainActivity.class);
  13. }
  14.  
  15. protected void setUp() throws Exception {
  16. super.setUp();
  17. mActivity = getActivity();
  18. }
  19.  
  20.  
  21. public void testText() {
  22. assertEquals("Hello David!",(String)mActivity.getText(com.example.dcarr1.R.string.hello_world));
  23. }
  24.  
  25.  
  26.  
  27.  
  28. protected void tearDown() throws Exception {
  29. super.tearDown();
  30. mActivity.finish();
  31. }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment