Esempio n. 1
0
        public void RemoveCourse(Course courseToRemove)
        {
            bool courseIsFound = this.CourseExists(courseToRemove);

            if (!courseIsFound)
            {
                throw new ArgumentException("No such course found");
            }

            this.courses.Remove(courseToRemove);
        }
Esempio n. 2
0
        private bool CourseExists(Course courseToCheck)
        {
            bool isFound = false;

            foreach (var course in this.courses)
            {
                if (courseToCheck.CourseName == course.CourseName)
                {
                    isFound = true;
                }
            }

            return isFound;
        }
Esempio n. 3
0
 public void AddCourse(Course courseToAdd)
 {
     this.courses.Add(courseToAdd);
 }