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