예제 #1
0
        public void StudentGroupShouldThrowIfNoSuchStudentToRemove()
        {
            var myClass = new StudentGroup("TelerikAcad");
            var student = new Student("Pe6o Ubaveca", Student.MinValidId);

            myClass.RemoveStudent(student);
        }
예제 #2
0
        public void StudentGroupShouldRemoveStudent()
        {
            var myClass = new StudentGroup("TelerikAcad");
            var student = new Student("Pe6o Ubaveca", Student.MinValidId);

            myClass.AddStudent(student);
            Assert.AreEqual(1, myClass.Students.Count);
            myClass.RemoveStudent(student);
            Assert.AreEqual(0, myClass.Students.Count);
        }
예제 #3
0
        private static void UsingClassStudentGroup()
        {
            StudentGroup group1 = new StudentGroup();


            Student std1 = new Student("Василий", "Пяточкин");

            group1.AddStudent(std1);
            GenerateRates(std1);

            Student std2 = new Student("Аркадий", "Лампочкин");

            group1.AddStudent(std2);
            GenerateRates(std2);

            Student std3 = new Student("Петр", "Самоделкин");

            group1.AddStudent(std3);
            GenerateRates(std3);

            Student std4 = new Student("Михаил", "Корягин");

            group1.AddStudent(std4);
            GenerateRates(std4);

            Student std5 = new Student("Наталия", "Скакалкина");

            group1.AddStudent(std5);
            GenerateRates(std5);

            group1.RemoveStudent(std5);

            //ошибка
            Student std6 = new Student("Ольга", "Кузнецова");

            group1.AddStudent(std6);
            GenerateRates(std6);

            //средняя оценка по каждому из студентов
            group1.PrintAverageRateEachStudent();

            group1.PrintAverageRateByGroup();


            Console.WriteLine("\n");
        }
예제 #4
0
        public void StudentGroupShouldThrowOnNullStudentRemove()
        {
            var myClass = new StudentGroup("TelerikAcad");

            myClass.RemoveStudent(null);
        }