Пример #1
0
        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));
            }
        }
Пример #2
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");
        }