public void testAddNewStudent() { //contoller = new FrontController().getStudentController(); Student std = new Student(); std.StudentID = "123"; std.FirstName = "any"; int asd = contoller.getAllStudents().Count; contoller.addOrUpdateStudent(std); int sample2 = contoller.getAllStudents().Count; Assert.AreEqual(contoller.getStudent("123"), std); Assert.AreEqual(contoller.getStudent("123").FirstName, std.FirstName); Assert.AreNotEqual(contoller.getAllStudents().Count, asd); Assert.AreEqual(sample2, contoller.getAllStudents().Count); }
public void setup() { //1.Setup the environment by holding a link to the old state (student list) //2.Create a new list of students //3.Use the frontcontroller to add to the state //4.Run the EGPXMLParser on HomeroomSample and CombinedGradebooks //Get the controller //controller = FrontController.getInstance().getStudentController(); //Save a state to the old records oldRecords = controller.getAllStudents(); State.getInstance().Students.Clear(); //Student s = new Student(); //s.RptCard.Periods.Clear(); //Period p = new Period(); //p.Skills.Clear(); //Clear the list of students //controller.clearStudents(); //Get the xml document //XmlDocument doc = Utilities.FileData.getXmlFromPath("Put the path to the CombinedGradebooks here"); ////Parse the homeroom xml //EGPXMLParser.parseHomeroomXML(controller, doc); }