public void controllerTest() { controller.add("1", "name", "1231231231", "ab"); Assert.AreEqual(controller.getAll().Count, 1); controller.update("1", "1", "name name", "1231231231", "ab"); Candidate c = controller.getById("1"); Assert.AreEqual(c.Name, "name name"); }
/* * Gets data for candidate table */ public List <Candidate> getCandidateData() { List <Candidate> candidatesForDepartment = new List <Candidate>(); if (listBoxDepartments.SelectedItem != null) { Department department = (Department)listBoxDepartments.SelectedItem; List <int> idCandidates = optionController.candidatesForDepartment(department.Id); foreach (int id in idCandidates) { candidatesForDepartment.Add(candidateController.getById(id.ToString())); } } return(candidatesForDepartment); }