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"); }
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 "); }
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; }