package guitests;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

//import org.junit.Test;

import guitests.guihandles.TaskCardHandle;
import seedu.task.commons.core.Messages;
//import seedu.task.commons.core.Messages;
import seedu.task.testutil.TestTask;
import seedu.task.testutil.TestUtil;

public class AddCommandTest extends TaskManagerGuiTest {

//     @Test
//     public void add() {
//    
//     // add one task
////     TestTask[] currentList = td.getTypicalTasks();
////     TestTask taskToAdd = td.zoo;
////     assertAddSuccess(taskToAdd, currentList);
////     currentList = TestUtil.addTasksToList(currentList, taskToAdd);
////    
////     // add another person
////     taskToAdd = td.yam;
////     assertAddSuccess(taskToAdd, currentList);
////     currentList = TestUtil.addTasksToList(currentList, taskToAdd);
//    
//     // invalid command
//     commandBox.runCommand("adds Johnny");
//     assertResultMessage(Messages.MESSAGE_UNKNOWN_COMMAND);
//     }

    private void assertAddSuccess(TestTask taskToAdd, TestTask... currentList) {
        commandBox.runCommand(taskToAdd.getAddCommand());

        // confirm the new card contains the right data
        TaskCardHandle addedCard = taskListPanel
                .navigateToTask(taskToAdd.getTaskName().fullTaskName);
        assertMatching(taskToAdd, addedCard);

        // confirm the list now contains all previous persons plus the new
        // task
        TestTask[] expectedList = TestUtil.addTasksToList(currentList, taskToAdd);
        assertTrue(taskListPanel.isListMatching(expectedList));
    }

}

@@ -60,58 +60,8 @@
 e;%0A%0A
-import org.junit.Test;%0A%0A//import org.junit.Test;%0A%0A
 impo
@@ -103,92 +103,8 @@
 le;%0A
-import seedu.task.commons.core.Messages;%0A//import seedu.task.commons.core.Messages;%0A
 impo
@@ -236,27 +236,27 @@
  %7B%0A%0A
-//
     
+//
  @Test%0A
-//
     
+//
  pub
@@ -272,29 +272,29 @@
 add() %7B%0A
-//
     
-%0A
 //
+%0A
     
+//
  // add 
@@ -302,24 +302,22 @@
 ne task%0A
-////
     
+//
  TestTas
@@ -356,24 +356,22 @@
 asks();%0A
-////
     
+//
  TestTas
@@ -392,24 +392,22 @@
 td.zoo;%0A
-////
     
+//
  assertA
@@ -437,32 +437,30 @@
 rrentList);%0A
-////
     
+//
  currentList
@@ -515,25 +515,21 @@
 d);%0A
-////
     
-%0A
 //
-//
+%0A
     
+//
  // 
@@ -547,24 +547,22 @@
  person%0A
-////
     
+//
  taskToA
@@ -574,24 +574,22 @@
 td.yam;%0A
-////
     
+//
  assertA
@@ -627,16 +627,14 @@
 t);%0A
-////
     
+//
  cur
@@ -697,21 +697,21 @@
 d);%0A
-//
     
-%0A
 //
+%0A
     
+//
  // 
@@ -726,22 +726,22 @@
 command%0A
-//
     
+//
  command
@@ -771,22 +771,22 @@
 hnny%22);%0A
-//
     
+//
  assertR
@@ -837,14 +837,14 @@
 D);%0A
-//
     
+//
  %7D%0A%0A

Test Cases