static void Main(string[] args) { Course math = new Course("Math"); for (int i = 0; i < 30; i++) { math.AddStudent(new Student("Test Student : " + i)); } Console.WriteLine(math); math.RemoveStudentByID(10000); math.RemoveStudentByID(10001); math.RemoveStudentByID(10002); Console.WriteLine(math); //throw exception //math.RemoveStudentByID(9); SchoolDem PMG = new SchoolDem("PMG"); PMG.AddCourse(math); //throwing exceptions //PMG.AddCourse(math); //PMG.AddCourse(null); Console.WriteLine(PMG); var school = new SchoolDem("Banichka"); var course = new Course("Alg"); school.AddCourse(course); Console.WriteLine(school); }
public void RemoveStudenFromEmptyList_ThrowException() { var spirt = new Course("Spirt"); spirt.RemoveStudentByID(99); }
public void RemoveStudenByIncorrectID_ThrowException() { var spirt = new Course("Spirt"); spirt.AddStudent(new Student("sad")); spirt.RemoveStudentByID(99); }
public void RemovingStudentThatDoesNotExistInTheList() { var bakery = new Course("Bakery"); var student = new Student("Fhilip"); bakery.AddStudent(student); bakery.RemoveStudentByID(20000); }
public void RemovingCorrectlyStudent_TrueIfRemovedCorrectly() { var spirt = new Course("Spirt"); var student = new Student("sad"); spirt.AddStudent(student); spirt.RemoveStudentByID(student.UniqueID); var index = spirt.ToString().IndexOf(student.ToString()); Assert.IsTrue(index < 0); }