public void DeleteTask() { TaskList listOfTasks = new TaskList(); Assert.IsTrue(listOfTasks.CreateTask("Title", "Some text ddfjdfjdfjdfjdjfdfj", DateTime.UtcNow)); Assert.IsTrue(listOfTasks.DeleteTask(0)); Assert.AreEqual(listOfTasks.GetTaskListLenght(), 0); }
public void DeleteTask_Root() { TaskList taskList = new TaskList(); taskList.Reset(); Task level0_task = new Task("Level 0 Task", DateTime.MaxValue, null); taskList.AddTask(level0_task); taskList.DeleteTask(level0_task); bool exists = CheckContainerExists(level0_task, taskList.GetTaskContainer()); Assert.IsFalse(exists); }
public void DeleteTask_Level1() { string name = "Level 1 Task"; TaskList taskList = new TaskList(); taskList.Reset(); //Parent Task Task level0_task = new Task("Root Task", DateTime.MaxValue, null); taskList.AddTask(level0_task); //SubTask Task level1_task = new Task(name, DateTime.MaxValue, level0_task); taskList.AddTask(level1_task); taskList.DeleteTask(level1_task); bool exists = CheckContainerExists(level1_task, taskList.GetTaskContainer()); Assert.IsFalse(exists); }