public void View_Past_Project(object sender, RoutedEventArgs e) { Project selected_project = (Project)Past_Projects_Listbox.SelectedItem; this.project_to_display = selected_project; Single_Project_Container.DataContext = this; int project_to_display_id = this.project_to_display.ProjectId; Notes = note_repo.GetAllByProjectId(project_to_display_id); Notes_Listbox.DataContext = Notes; Dependency_Listbox.DataContext = dependency_repo.GetAllByProjectId(project_to_display_id); Colors_Listbox.DataContext = color_repo.GetAllByProjectId(project_to_display_id); _show_view(Past_Projects_List, false); _show_view(Single_Project_Container, true); if (Colors_Listbox.Items.Count == 0) { _show_list(Colors_Listbox, false); } if (Notes_Listbox.Items.Count == 0) { _show_list(Notes_Listbox, false); } if (Dependency_Listbox.Items.Count == 0) { _show_list(Dependency_Listbox, false); } }
public void GivenThereAreXNotes() { int project_id = ProjectRepo.All()[0].ProjectId; NoteRepo.Add(new Note("This project needs css work", project_id)); NoteRepo.Add(new Note("This project needs js work", project_id)); Assert.AreEqual(2, NoteRepo.GetAllByProjectId(project_id).Count); }
public void TestNotesGetAllByProjectIdMethod() { int project_id = project_repo.All()[0].ProjectId; note_repo.Add(new Note("this is a test note", project_id)); note_repo.Add(new Note("this is a note 2", project_id)); var notes = note_repo.GetAllByProjectId(project_id); Assert.AreEqual(notes.Count, 2); int first_note_id = notes[0].NoteId; int second_note_id = notes[1].NoteId; Assert.AreEqual("this is a test note", note_repo.GetById(first_note_id).NoteDetails); Assert.AreEqual("this is a note 2", note_repo.GetById(second_note_id).NoteDetails); }