diff --git a/app/src/test/java/com/cmput301f17t11/cupofjava/HabitEventHistoryTest.java b/app/src/androidTest/java/com/cmput301f17t11/cupofjava/HabitEventHistoryTests.java similarity index 96% rename from app/src/test/java/com/cmput301f17t11/cupofjava/HabitEventHistoryTest.java rename to app/src/androidTest/java/com/cmput301f17t11/cupofjava/HabitEventHistoryTests.java index bb37510..281f4c3 100644 --- a/app/src/test/java/com/cmput301f17t11/cupofjava/HabitEventHistoryTest.java +++ b/app/src/androidTest/java/com/cmput301f17t11/cupofjava/HabitEventHistoryTests.java @@ -10,8 +10,8 @@ import java.util.Comparator; import java.util.Date; -public class HabitEventHistoryTest extends ActivityInstrumentationTestCase2 { - public HabitEventHistoryTest(){ +public class HabitEventHistoryTests extends ActivityInstrumentationTestCase2 { + public HabitEventHistoryTests(){ super(com.cmput301f17t11.cupofjava.MainActivity.class); } @@ -37,7 +37,7 @@ public void testDelete(){ assertFalse(eventHistory.hasHabitEvent(event)); } - public void testGetHabitEvent(){ + public void testGetHabitEvent(){ //Habit habit = new Habit("adding habit", "for test",Calendar.getInstance()); HabitEvent event = new HabitEvent("comment1"); HabitEventHistory eventHistory = new HabitEventHistory(); diff --git a/app/src/test/java/com/cmput301f17t11/cupofjava/HabitListTest.java b/app/src/androidTest/java/com/cmput301f17t11/cupofjava/HabitListTest.java similarity index 100% rename from app/src/test/java/com/cmput301f17t11/cupofjava/HabitListTest.java rename to app/src/androidTest/java/com/cmput301f17t11/cupofjava/HabitListTest.java diff --git a/app/src/androidTest/java/com/cmput301f17t11/cupofjava/UserLoginActivityTest.java b/app/src/androidTest/java/com/cmput301f17t11/cupofjava/UserLoginActivityTest.java index 6420d85..6af5496 100644 --- a/app/src/androidTest/java/com/cmput301f17t11/cupofjava/UserLoginActivityTest.java +++ b/app/src/androidTest/java/com/cmput301f17t11/cupofjava/UserLoginActivityTest.java @@ -109,6 +109,7 @@ public void testLogin(){ solo.clickOnText("DELETE"); solo.sleep(2000); + //test timeline button solo.assertCurrentActivity("parent activity", TodayViewActivity.class); solo.clickOnView(solo.getView(R.id.action_timeline)); solo.assertCurrentActivity("child activity", HabitEventTimeLineActivity.class); diff --git a/app/src/main/java/com/cmput301f17t11/cupofjava/AllHabitViewActivity.java b/app/src/main/java/com/cmput301f17t11/cupofjava/AllHabitViewActivity.java index 40d700a..b85cf6e 100644 --- a/app/src/main/java/com/cmput301f17t11/cupofjava/AllHabitViewActivity.java +++ b/app/src/main/java/com/cmput301f17t11/cupofjava/AllHabitViewActivity.java @@ -21,6 +21,10 @@ public class AllHabitViewActivity extends Activity { private String userName; private int userIndex; + public ListView getListView(){ + return listView; + } + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);