Example #1
0
        public void AddCourse_WhenTheCourseIsNotContainedInTheSchool()
        {
            var course = new Course("Algebra", new List<Student>()
            {
                new Student("Albert", 10001)
            });

            School school = new School();
            school.AddCourse(course);

            Assert.IsTrue(school.FindCourse(course.Name));
        }
Example #2
0
        public void AddCourse_WhenTheCourseIsContainedInTheSchool_ShouldThrowException()
        {
            var course = new Course("Algebra",
                new List<Student>()
                {
                    new Student("Albert", 10001)
                });

            School school = new School(
                new List<Course>()
                {
                    course
                });

            school.AddCourse(course);
        }
Example #3
0
        public void RemoveCourse_WhenTheCourseIsContainedInTheSchool()
        {
            var course = new Course("Algebra",
                new List<Student>()
                {
                    new Student("Albert", 10001)
                });

            School school = new School(
                new List<Course>()
                {
                    course
                });

            school.RemoveCourse(course.Name);
            Assert.IsFalse(school.FindCourse(course.Name));
        }