public void TestMethod_Add() { ITaskListManager c = new TaskListManager(); ToDoTask task = new ToDoTask() { ToDoListID = 1, ToDoTaskName = "My new task", SortOrder = 0 }; var addedTask = c.Add(task); var data = c.GetAll(); Assert.AreEqual(1, data.Count); }
public void TestMethod_AddDelete() { ITaskListManager c = new TaskListManager(); ToDoTask task = new ToDoTask() { ToDoListID = 1, ToDoTaskName = "My next task", SortOrder = 0 }; var addedTask = c.Add(task); var data = c.GetAll(); Assert.AreEqual(1, data.Count); //remove the item, then check c.Remove(addedTask.ToDoTaskID); data = c.GetAll(); Assert.AreEqual(0, data.Count); }
public void TestMethod_AddModify() { ITaskListManager c = new TaskListManager(); ToDoTask task = new ToDoTask() { ToDoListID = 1, ToDoTaskName = "My new task", SortOrder = 0 }; c.Add(task); var data = c.GetAll(); Assert.AreEqual(1, data.Count); task.ToDoTaskName = UpdatedTaskName; c.Update(task); var updatedTask = c.Get(task.ToDoTaskID); Assert.AreEqual(UpdatedTaskName, updatedTask.ToDoTaskName); }
public void Add(TaskList taskItem) { _taskListManager.Add(taskItem); }