package ca.ualberta.cs.f14t07_application.test;

import android.test.ActivityInstrumentationTestCase2;

public class SearchTest extends ActivityInstrumentationTestCase2<QuestionList> {

    public SearchTest(){
    	super(PostList.class);
    }

    public void getSearchTermTest(){
    	String searchTerm = "foo";
    	String inputedTerm = getSearchTerm();
    	assertEquals(inputedTerm,searchTerm);	
    }

    public void sortBySearchTerm()){
    	PostList posts = new PostList;
		posts.add(new Question("no term"));
		posts.add(new Question("still no term"));
		posts.add(new Question("has foo!"));
		posts.add(new Question("has foo foo twice!")); //If it has the search term twice, it should probably be above? (Tested in sortedList2)
		posts.sortBySearchTerm("foo");

		ArrayList<Question> sortedList = new ArrayList<Question>();
		sortedList.add(new Question("has foo!"));
		sortedList.add(new Question("has foo foo twice!"));
		sortedList.add(new Question("no term"));
		sortedList.add(new Question("still no term"));
		assertEquals(posts.getlist(), sortedList);
		
		ArrayList<Question> sortedList2 = new ArrayList<Question>();
		sortedList2.add(new Question("has foo foo twice!"));
		sortedList2.add(new Question("has foo!"));
		sortedList2.add(new Question("no term"));
		sortedList2.add(new Question("still no term"));
		assertEquals(posts.getlist(), sortedList2);
    }

}

@@ -215,20 +215,26 @@
  %09super(
-Post
+ForumEntry
 List.cla
@@ -450,20 +450,26 @@
 )%7B%0A    %09
-Post
+ForumEntry
 List pos
@@ -481,12 +481,18 @@
 new 
-Post
+ForumEntry
 List
@@ -505,32 +505,34 @@
 sts.add(new 
-Question
+ForumEntry
 (%22no term%22))
@@ -545,32 +545,34 @@
 sts.add(new 
-Question
+ForumEntry
 (%22still no t
@@ -591,32 +591,34 @@
 sts.add(new 
-Question
+ForumEntry
 (%22has foo!%22)
@@ -632,32 +632,34 @@
 sts.add(new 
-Question
+ForumEntry
 (%22has foo fo
@@ -801,32 +801,34 @@
 %09%09ArrayList%3C
-Question
+ForumEntry
 %3E sortedList
@@ -840,32 +840,34 @@
 w ArrayList%3C
-Question
+ForumEntry
 %3E();%0A%09%09sorte
@@ -876,32 +876,34 @@
 ist.add(new 
-Question
+ForumEntry
 (%22has foo!%22)
@@ -922,32 +922,34 @@
 ist.add(new 
-Question
+ForumEntry
 (%22has foo fo
@@ -978,32 +978,34 @@
 ist.add(new 
-Question
+ForumEntry
 (%22no term%22))
@@ -1023,32 +1023,34 @@
 ist.add(new 
-Question
+ForumEntry
 (%22still no t
@@ -1117,24 +1117,26 @@
 rayList%3C
-Question
+ForumEntry
 %3E sorted
@@ -1157,24 +1157,26 @@
 rayList%3C
-Question
+ForumEntry
 %3E();%0A%09%09s
@@ -1190,32 +1190,34 @@
 st2.add(new 
-Question
+ForumEntry
 (%22has foo fo
@@ -1251,24 +1251,26 @@
 add(new 
-Question
+ForumEntry
 (%22has fo
@@ -1298,24 +1298,26 @@
 add(new 
-Question
+ForumEntry
 (%22no ter
@@ -1344,24 +1344,26 @@
 add(new 
-Question
+ForumEntry
 (%22still 

Update SearchTest.java