Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
 public void Add(TaskList taskItem)
 {
     _taskListManager.Add(taskItem);
 }