コード例 #1
0
        public void TestForCorrectSetFirstAndLastNameInWelcomeStudentForm()
        {
            var    register = new StudentFormController();
            string egnPass  = "******";
            string result   = register.SetFirstLastName(egnPass);

            string actions = "Julia James";

            Assert.AreEqual(result, actions, "Correct set first and last name on Student");
        }
コード例 #2
0
        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");
        }
コード例 #3
0
        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");
        }
コード例 #4
0
        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");
        }
コード例 #5
0
        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");
        }
コード例 #6
0
        public void TestForCorrectInitializeSubjects()
        {
            var register = new StudentFormController();
            var subject  = new Subject();

            subject.Name = "Physics";

            string selectedSubjectName = "Physics";

            register.InitializeSubject(selectedSubjectName);

            var result = register.CurrentselectedSubject.Name;

            Assert.AreEqual(subject.Name, result, "Correct initialize student subject chek by subject.name");
        }
コード例 #7
0
        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 ");
        }
コード例 #8
0
        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");
        }
コード例 #9
0
        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;
        }
 public StudentForm(Student student, StudentBll studentBll, CourseBll courseBll)
 {
     _student = student;
     InitializeComponent();
     _studentFormController = new StudentFormController(this, studentBll, courseBll);
 }