Esempio n. 1
0
 private void InitializeForm()
 {
     myIOHandler.LoadTaskList(myToDoList);
     foreach (Task task in myToDoList.Tasks)
     {
         PopulateTodoList(task.Description, task.IsDone);
     }
 }
Esempio n. 2
0
 private void btnLoadList_Click(object sender, EventArgs e)
 {
     // clear the checkBoxList
     for (int i = clbToDoList.Items.Count - 1; i >= 0; i--)
     {
         clbToDoList.Items.RemoveAt(i);
     }
     clbToDoList.Refresh();
     myToDoList.Tasks.Clear();
     myIOHandler.LoadTaskList(myToDoList);
     foreach (Task task in myToDoList.Tasks)
     {
         PopulateTodoList(task.Description, task.IsDone);
     }
 }
Esempio n. 3
0
        private void List_LoadList()
        {
            // This test is fragile as it relies on having the list from List_SaveList already
            // run.  Better would be for it to pull in a separate file, but that would
            // require modifying ListIOFunctions.LoadTaskList to suppoort having a filename
            ToDoList testList = new ToDoList();
            ListIO   listIO   = new ListIO();

            listIO.LoadTaskList(testList);
            testList.Tasks[0].Description.ShouldBe("List_SaveList One");
            testList.Tasks[0].IsDone.ShouldBe(true);
            testList.Tasks[1].Description.ShouldBe("List_SaveList Two");
            testList.Tasks[1].IsDone.ShouldBe(false);
            testList.Tasks[2].Description.ShouldBe("List_SaveList Three");
            testList.Tasks[2].IsDone.ShouldBe(true);
        }