public void TestCourseRemoveStudentMethodIfValidStudentIsPassedToBeRemoved() { var student = new Student("aaa", 12345); var myCourse = new Course("aa"); myCourse.AddStudent(student); myCourse.RemoveStudent(student); Assert.AreEqual(myCourse.Students.Count, 0); }
public void TestCourseRemoveStudentMethodIfInvalidStudentIsPassedToBeRemoved() { var validStudent = new Student("aaa", 12345); var invalidStudent = new Student("we", 12345); var myCourse = new Course("aa"); myCourse.AddStudent(validStudent); myCourse.RemoveStudent(invalidStudent); }
public void TryingToRemoveUnexistingStudent() { School mySchool = new School(); Course math = new Course(); for (int i = 0; i < 30; i++) { math.AddStudent(new Student("Pesho", 10000 + i, mySchool)); } math.RemoveStudent(new Student("Gosho", 34322, mySchool)); }
public void LeaveCourse(Course course) { if (course == null) { throw new ArgumentNullException("You must provide a course!"); } course.RemoveStudent(this); }