public void determineAddCommandTest_ST_SD()
 {
     UI testui = new UI();
      OperationHandler target = new OperationHandler();
      string input = Utility.TEST_NORMAL_ADDTASK_3;
      OperationHandler.determineCommand(input);
      string expected ="08/10/2012 08:00:00 ";
      string actual = Storage.getTaskList()[Storage.getTaskList().Count - 1].setStart + " ";
      Assert.AreEqual(expected, actual);
 }
 public void determineAddCommandTest2_TD()
 {
     UI testui = new UI();
      OperationHandler target = new OperationHandler();
      string input = "add "+Utility.TEST_NORMAL_ADDTASK_1;
      OperationHandler.determineCommand(input);
      string expected = Utility.TEST_NORMAL_ADDTASK_1;
      string actual = Storage.getTaskList()[Storage.getTaskList().Count - 1].setTaskDescription + Utility.SPACE_CHAR;
      Assert.AreEqual(expected, actual);
 }
        public void instantMultifieldSearchTest()
        {
            UI newUI = new UI();
            OperationHandler.determineCommand(Utility.TEST_NORMAL_ADDTASK_1);
            OperationHandler.determineCommand(Utility.TEST_NORMAL_ADDTASK_2);
            OperationHandler.determineCommand(Utility.TEST_NORMAL_ADDTASK_3);
            OperationHandler.determineCommand(Utility.TEST_NORMAL_ADDTASK_4);
            OperationHandler.determineCommand(Utility.TEST_NORMAL_ADDTASK_5);

            string actual = PowerSearch.instantSearch(Utility.TEST_POWERSEARCH_KEYWORD2)[0].setTaskDescription;
            string expected = Utility.TEST_POWERSEARCH_RESULT1;
            Assert.AreEqual(expected, actual);
        }
        public void undoCompleteTest()
        {
            UndoRedo target = new UndoRedo();
            UI newui = new UI();

            OperationHandler.determineCommand(Utility.TEST_NORMAL_ADDTASK_1);
            OperationHandler.determineCommand(Utility.TEST_UNDOREDO_COMPLETE);

            target.undo();
            bool actual = Storage.getTaskList()[0].setIsCompleted;
            bool expected = false;
            Assert.AreEqual(expected, actual);

            target.redo();
            actual = Storage.getTaskList()[0].setIsCompleted;
            expected = true;
            Assert.AreEqual(expected, actual);
        }
        public void undoEditTest()
        {
            UndoRedo target = new UndoRedo();
            UI newui = new UI();

            OperationHandler.determineCommand(Utility.TEST_UNDOREDO_TASK);
            OperationHandler.determineCommand(Utility.TEST_EDIT_TASK_TASK_DESCRIPTION);

            target.undo();
            string actual = Storage.getTaskList()[0].setTaskDescription;
            string expected = Utility.TEST_UNDOREDO_TASK;
            Assert.AreEqual(expected, actual);

            target.redo();
            actual = Storage.getTaskList()[0].setTaskDescription;
            expected = Utility.TEST_EDITED_TASK_DESCRIPTION;
            Assert.AreEqual(expected, actual);
        }
        public void undoDeleteTest()
        {
            UndoRedo target = new UndoRedo();
            UI newui = new UI();

            OperationHandler.determineCommand(Utility.TEST_UNDOREDO_TASK);
            OperationHandler.determineCommand(Utility.TEST_DELETE_TASK_1);

            target.undo();
            int actual = Storage.getTaskList().Count;
            int expected = 1;
            Assert.AreEqual(expected, actual);
        }
 public void determineCompleteCommandTest()
 {
     UI testui = new UI();
      OperationHandler target = new OperationHandler();
      string input = Utility.TEST_NORMAL_ADDTASK_1;
      OperationHandler.determineCommand(input);
      OperationHandler.determineCommand("complete 1");
      bool expected = true;
      bool actual = Storage.getTaskList()[Storage.getTaskList().Count - 1].setIsCompleted ;
      Assert.AreEqual(expected, actual);
 }
        public void determineSearchCommandTest2()
        {
            UI testui = new UI();
             OperationHandler target = new OperationHandler();
             string input1 = Utility.TEST_NORMAL_ADDTASK_1;
             string input2 = Utility.TEST_NORMAL_ADDTASK_2;
             string input3 = Utility.TEST_NORMAL_ADDTASK_3;
             string input4 = Utility.TEST_NORMAL_ADDTASK_4;
             string input5 = Utility.TEST_NORMAL_ADDTASK_5;
             OperationHandler.determineCommand(input1);
             OperationHandler.determineCommand(input2);
             OperationHandler.determineCommand(input3);
             OperationHandler.determineCommand(input4);
             OperationHandler.determineCommand(input5);
             List<Task> searchedlist = OperationHandler.determineCommand("search 12/12");

             int expected = 1;
             int actual = searchedlist.Count;
             Assert.AreEqual(expected, actual);
        }