package seedu.task.model.task;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

import java.util.ArrayList;
import java.util.Collections;

import org.junit.Test;

import seedu.task.model.tag.UniqueTagList;

public class TaskComparableTest {

    @Test
    public void sortByComplete() {
        String description = "task description";
        String priority = "2";
        String timing = "03/03/2017";
        String tag1 = "friendship";
        String tag2 = "love";
        try {
            Task t1 = new Task(new Description("one"), new Priority(priority),
                    new Timing(timing), new Timing(timing), new UniqueTagList(tag1, tag2));
            Task t2 = new Task(new Description("two"), new Priority(priority),
                    new Timing(timing), new Timing(timing), new UniqueTagList(tag1, tag2));

            ArrayList<Task> al = new ArrayList<Task>();
            al.add(t1);
            al.add(t2);
            t1.setComplete();
            Collections.sort(al);

            ArrayList<Task> expected = new ArrayList<Task>();
            expected.add(t2);
            expected.add(t1);
            assertEquals(al, expected);

        } catch (Exception e) {
            e.printStackTrace();
            fail();
        }
    }

    //    private void printDescriptions(ArrayList<Task> al) {
    //        System.out.println("Starting print...");
    //        for (Task t : al) {
    //            System.out.println(t.getDescription());
    //        }
    //        System.out.println("Ending print.");
    //
    //    }
}

@@ -234,16 +234,35 @@
 agList;%0A
+//@@author A163559U
 %0Apublic 
@@ -1607,8 +1607,19 @@
     %7D%0A%7D%0A
+//@@author%0A

add author tags to TaskComparableTest