public void OperationScheduleParseTest() { testCmdParser = new CommandParser(); Operation op1 = testCmdParser.ParseOperation("task jan 15th midnight - jan 30th morning schedule 3000 hours"); Assert.AreEqual("ToDo.OperationSchedule", op1.GetType().ToString()); return; }
public void OperationSearchDeadlineParseTest() { testCmdParser = new CommandParser(); Operation op1 = testCmdParser.ParseOperation("search by 2013 oct 30th 5:49 pm"); Assert.AreEqual("ToDo.OperationSearch", op1.GetType().ToString()); return; }
public void OperationTimedParseTest() { testCmdParser = new CommandParser(); Operation op1 = testCmdParser.ParseOperation("task do stuff add sunday morning to wed 13:20 "); Assert.AreEqual("ToDo.OperationAdd", op1.GetType().ToString()); return; }
public void OperationInvalidParseTest() { testCmdParser = new CommandParser(); bool flag = false; try { testCmdParser.ParseOperation("add delete modify"); } catch (MultipleCommandsException) { flag = true; } Assert.IsTrue(flag); return; }
/// <summary> /// Constructor for Logic class. Initializes all necessary components. /// </summary> public Logic() { mainSettings = new Settings(); storage = new Storage("ToDo++.xml", "ToDoSettings.xml"); mainSettings.UpdateSettings(storage.LoadSettingsFromFile()); EventHandlers.UpdateSettingsHandler += UpdateSettings; commandParser = new CommandParser(); taskList = storage.LoadTasksFromFile(); while (taskList == null) { PromptUser_CreateNewTaskFile(); taskList = storage.LoadTasksFromFile(); } }