Beispiel #1
0
 public void LeaveCourse(Course course)
 {
     if (course == null)
     {
         throw new ArgumentNullException("Course can't be null");
     }
     course.RemoveStudent(this);
 }
 public void TestCourse_RemoveStudentArgumentNone()
 {
     Course testCourse = new Course(courseName, teacherName);
     Student gosho = new Student("Gosho");
     testCourse.RemoveStudent(gosho);
 }
 public void TestCourse_RemoveStudentNullStudent()
 {
     Course testCourseNull = new Course(courseName, teacherName);
     testCourseNull.RemoveStudent(null);
 }
 public void TestCourse_RemoveStudent()
 {
     Course course = new Course(courseName, teacherName);
     Student pesho = new Student("Pesho");
     course.AddStudent(pesho);
     course.RemoveStudent(pesho);
     Assert.IsFalse(course.Students.Contains(pesho), "Student is still in the course");
 }