Exemplo 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);
        }
Exemplo 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;
        }
Exemplo n.º 3
0
 public void AddCourse(Course courseToAdd)
 {
     this.courses.Add(courseToAdd);
 }