コード例 #1
0
ファイル: SchoolTests.cs プロジェクト: androidejl/Telerik
        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));
        }
コード例 #2
0
ファイル: SchoolTests.cs プロジェクト: androidejl/Telerik
        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);
        }
コード例 #3
0
ファイル: SchoolTests.cs プロジェクト: androidejl/Telerik
        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));
        }