public void OperationDeleteMultipleTest() { testStorage = new Storage("OpUnittest.xml", "OpUnittestsettings.xml"); testTaskList = testStorage.LoadTasksFromFile(); int[] index = new int[2] { 1, 2 }; OperationAdd Op = new OperationAdd(testTask, sortType); Op.Execute(testTaskList, testStorage); Op = new OperationAdd(testTaskNew, sortType); Op.Execute(testTaskList, testStorage); OperationDelete Op1 = new OperationDelete("", index, null, null, null, false, SearchType.NONE, sortType); result = Op1.Execute(testTaskList, testStorage); Assert.AreEqual("Deleted all indicated tasks successfully.", result.FeedbackString); return; }
public void OperationDeleteRangeFailTest() { testStorage = new Storage("OpUnittest.xml", "OpUnittestsettings.xml"); testTaskList = testStorage.LoadTasksFromFile(); int[] index = new int[2] { 1, 4 }; OperationDelete Op1; OperationAdd Op = new OperationAdd(testTask, sortType); result = Op.Execute(testTaskList, testStorage); Op1 = new OperationDelete("", index, null, null, null, false, SearchType.NONE, sortType); result = Op1.Execute(testTaskList, testStorage); Assert.AreEqual("Invalid task index!", result.FeedbackString); index = new int[2] { 1, 1 }; Op1 = new OperationDelete("", index, null, null, null, false, SearchType.NONE, sortType); result = Op1.Execute(testTaskList, testStorage); Assert.AreEqual("Deleted task \"test\" successfully.", result.FeedbackString); return; }