private void Form3_Load(object sender, EventArgs e) // R { ShowEventBar(); studentNameLabel.Text = studentController.SetFirstLastName(egnPass); // Add subjects collection to subjectComboBox { studentController.InitializeStudent(egnPass); for (int i = 0; i < studentController.SubjectsToInsert().Count; i++) { StudentSubjectsComboBox.Items.Add(studentController.SubjectsToInsert()[i]); } } // Loads all the contact info (except his own) of the class the student is in and orders it and its' respective head teacher { studentController.ContactInfo().ForEach(w => ContactInfoListBox.Items.Add(w)); HeadTeacherText = studentController.HTeacherContactInfo(); } // Orders The ContactInfoListBoxItems { List <string> tempList = new List <string>(); foreach (var item in ContactInfoListBox.Items) { tempList.Add(item.ToString()); } tempList = tempList.OrderBy(w => w).ToList(); ContactInfoListBox.Items.Clear(); tempList.ForEach(w => ContactInfoListBox.Items.Add(w)); } }
public void TestForCorrectContactInfo() { var register = new StudentFormController(); string egnPass = "******"; register.InitializeStudent(egnPass); string correct = "Annette O'Connell Email: W Phone number: 672-292-5299 Birthdate: 25.11.1965 г."; List <string> Lists = register.ContactInfo(); var action = Lists[0]; Assert.AreEqual(correct, action, "Correct set contact info list"); }
public void TestForCorrectInitializeCurrentStudentCheckByPersonalNumber() { var register = new StudentFormController(); var student = new Student(); student.PersonalNumber = "3376299241"; string egnPass = "******"; register.InitializeStudent(egnPass); var result = register.CurrentStudent.PersonalNumber; Assert.AreEqual(student.PersonalNumber, result, "Correct Initialize Student by personalNumber"); }
public void TestForCorrectHeadTeacherContactInfo() { var register = new StudentFormController(); string egnPass = "******"; register.InitializeStudent(egnPass); string action = "Raquel Cardenas Curry Email: [email protected] Phone number: 0888811111 Birthdate: 8.2.1969 г."; string result = register.HTeacherContactInfo(); Assert.AreEqual(action, result, "Correct add teacher info"); }
public void TestForCorrectInitializeStudentSubjects() { var register = new StudentFormController(); var subject = new Subject(); subject.Name = "Physics"; string egnPass = "******"; register.InitializeStudent(egnPass); var result = register.StudentSubjects[0]; Assert.AreEqual(subject.Name, result.Name, "Correct initialize student subject chek by subject.name"); }
private void Form3_Load(object sender, EventArgs e) // R { parentNameLabel.Text = parentController.SetFirstLastName(egnParentPass); studentNameLabel.Text = studentController.SetFirstLastName(egnStudentPass); // Add subjects collection to subjectComboBox { studentController.InitializeStudent(egnStudentPass); for (int i = 0; i < studentController.SubjectsToInsert().Count; i++) { StudentSubjectsComboBox.Items.Add(studentController.SubjectsToInsert()[i]); } } // Loads all the contact info (except his own) of the class the student is in and orders it and its' respective head teacher ShowEventBar(); }
public void TestForCorrectCalculateAllSetMarks() { var register = new StudentFormController(); string egnPass = "******"; register.InitializeStudent(egnPass); string selectedSubjectName = "Health and hygiene"; register.InitializeSubject(selectedSubjectName); register.StudentMarksToInsert(); var action = "3,32"; string result = register.AvarageMark(); Assert.AreEqual(action, result, "Correct calculated all marks "); }
public void TestForCorrectStudentMarksToInsert() { var register = new StudentFormController(); string egnPass = "******"; register.InitializeStudent(egnPass); string selectedSubjectName = "Physics"; register.InitializeSubject(selectedSubjectName); List <string> Lists = register.StudentMarksToInsert(); var action = "Bad 2,71 Teacher: Marissa Clarke Sutton Date: 8.6.2022 г."; var result = Lists[0]; Assert.AreEqual(action, result, "Correct set marks and teacher name in list box"); }
private void studentSubjectsComboBox_SelectedValueChanged(object sender, EventArgs e) { // Clears all the subjects from selected marks list box and gets the selected subject name SelectedMarksListBox.Items.Clear(); string selectedSubjectName = StudentSubjectsComboBox.SelectedItem.ToString(); // Load controller and make sure we are using the correct student and subject StudentFormController sfc = new StudentFormController(); sfc.InitializeStudent(egnPass); sfc.InitializeSubject(selectedSubjectName); // Inserts Studentmarks into the selectedMarksListBox List <string> StudentMarksToInsert = sfc.StudentMarksToInsert(); StudentMarksToInsert.ForEach(w => SelectedMarksListBox.Items.Add(w)); // Sets average mark with the avarage mark of all marks from the selected subject AvarageMark = "Average: " + sfc.AvarageMark(); averageMark.Visible = true; }