Esempio n. 1
0
        public void Delete_InCollection()
        {
            var task = new Task("(B) Delete_InCollection +test @task");
            var tl = new TaskList(Data.TestDataPath);
            tl.Add(task);

            var tasks = new OrderedList<Task>(tl.Tasks);
            tasks.Remove(tasks.Where(x => x.Raw == task.Raw).First());

            
            tl.Delete(task);

            var newTasks = tl.Tasks.ToList();

            Assert.AreEqual(tasks.Count, newTasks.Count);

            for (int i = 0; i < tasks.Count; i++)
                Assert.AreEqual(tasks[i].ToString(), newTasks[i].ToString());
        }