public void CompareDatesTest()
        {
            Task x = new Task();
            Task y = new Task();
            Parser target = new Parser();
            x = target.returnTask(Utility.TEST_TASK_X);
            y = target.returnTask(Utility.TEST_TASK_Y);

            int expected = 0;
            int actual;
            actual = Task.CompareDates(x, y);
            Assert.AreEqual(expected, actual);
        }
        private void appendNonExistingFields(int taskID, Parser parseTask)
        {
            if (userInput.IndexOf(parseTask.shortcutsToString(Utility.shortcuts.ed)) == Utility.INVALID_INDEX)
            {
                userInput += Utility.SPACE_CHAR + Utility.hyphen + Utility.shortcuts.ed.ToString()
                            + Utility.SPACE_CHAR + Storage.getTaskList()[taskID - 1].setEnd.ToString(Utility.DATE_FORMAT);
                mergeTask(taskID);
            }

            if (userInput.IndexOf(parseTask.shortcutsToString(Utility.shortcuts.et)) == Utility.INVALID_INDEX)
            {
                userInput += Utility.SPACE_CHAR + Utility.hyphen + Utility.shortcuts.et.ToString()
                            + Utility.SPACE_CHAR + Storage.getTaskList()[taskID - 1].setEnd.ToString(Utility.TIME_FORMAT);
                mergeTask(taskID);
            }

            if (userInput.IndexOf(parseTask.shortcutsToString(Utility.shortcuts.sd)) == Utility.INVALID_INDEX)
            {
                userInput += Utility.SPACE_CHAR + Utility.hyphen + Utility.shortcuts.sd.ToString()
                            + Utility.SPACE_CHAR + Storage.getTaskList()[taskID - 1].setStart.ToString(Utility.DATE_FORMAT);
                mergeTask(taskID);
            }

            if (userInput.IndexOf(parseTask.shortcutsToString(Utility.shortcuts.st)) == Utility.INVALID_INDEX)
            {
                userInput += Utility.SPACE_CHAR + Utility.hyphen + Utility.shortcuts.st.ToString()
                            + Utility.SPACE_CHAR + Storage.getTaskList()[taskID - 1].setStart.ToString(Utility.TIME_FORMAT);
                mergeTask(taskID);
            }
        }
        private string mergeTask(int taskID)
        {
            Parser parseTask = new Parser();
            Task editedTask = new Task();

            if (taskID > 0 && taskID <= Storage.getTaskList().Count)
            {
                log.Warn(Utility.LOG_PARSING_BEGINS);

                appendNonExistingFields(taskID, parseTask);
                editedTask = parseTask.returnTask(userInput.TrimStart());
                mergeTaskDescription(taskID, editedTask);
                mergeTaskTag(taskID, editedTask);

                if (editedTask.setStart > editedTask.setEnd
                    || editedTask.setEnd == DateTime.MinValue
                    || editedTask.setStart == DateTime.MinValue
                    || editedTask.setEnd == DateTime.MaxValue
                    || editedTask.setStart == DateTime.MaxValue
                    || editedTask.setEnd == DateTime.Parse(Utility.INVALID_STARTDATE_ENDDATE)
                    || editedTask.setStart == DateTime.Parse(Utility.INVALID_STARTDATE_ENDDATE))
                {
                    return Utility.ERROR_INVALID_DATETIME;
                }
                else
                {
                    Storage.getTaskList()[taskID - 1] = editedTask;
                    Storage.updateStorage();
                    return Utility.STATUS_TASK_EDITED;
                }
            }
            else
            {
                return Utility.ERROR_INVALID_TASKNO;
            }
        }
        public void returnTaskTest()
        {
            Parser target = new Parser();
            string input = Utility.TEST_PARSER_TASK_ALL;
            Task parsedtask = new Task();
            parsedtask = target.returnTask(input);

            string expected=Utility.TEST_PARSER_TASK_DESCRIPTION;
            string actual=parsedtask.setTaskDescription;
            Assert.AreEqual(expected, actual);

            expected = Utility.TEST_PARSER_START;
            actual = parsedtask.setStart+" ";
            Assert.AreEqual(expected, actual);

            expected = Utility.TEST_PARSER_END;
            actual = parsedtask.setEnd + " ";
            Assert.AreEqual(expected, actual);

            expected = Utility.TEST_PARSERTAG;
            actual = parsedtask.setTag;
            Assert.AreEqual(expected, actual);
        }