public void StudentGroupShouldThrowIfNoSuchStudentToRemove() { var myClass = new StudentGroup("TelerikAcad"); var student = new Student("Pe6o Ubaveca", Student.MinValidId); myClass.RemoveStudent(student); }
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); }
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"); }
public void StudentGroupShouldThrowOnNullStudentRemove() { var myClass = new StudentGroup("TelerikAcad"); myClass.RemoveStudent(null); }