当前位置: 首页>>代码示例>>C#>>正文


C# Student.JoinCourse方法代码示例

本文整理汇总了C#中School.Student.JoinCourse方法的典型用法代码示例。如果您正苦于以下问题:C# Student.JoinCourse方法的具体用法?C# Student.JoinCourse怎么用?C# Student.JoinCourse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在School.Student的用法示例。


在下文中一共展示了Student.JoinCourse方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CourseShouldThrowIfStudentAlreadyAdded

 public void CourseShouldThrowIfStudentAlreadyAdded()
 {
     var course = new Course("Maths");
     var student = new Student("unnamed", Student.MinValidId);
     student.JoinCourse(course);
     student.JoinCourse(course);
 }
开发者ID:tddold,项目名称:TelerikAcademy-5,代码行数:7,代码来源:CourseTests.cs

示例2: StudentShouldNotThrowWhenLeavingCourse

 public void StudentShouldNotThrowWhenLeavingCourse()
 {
     var course = new Course("testCourse");
     var st = new Student("Pesho", 15000);
     st.JoinCourse(course);
     st.LeaveCourse(course);
 }
开发者ID:tddold,项目名称:TelerikAcademy-5,代码行数:7,代码来源:StudentTests.cs

示例3: CourseShouldAddStudent

 public void CourseShouldAddStudent()
 {
     var course = new Course("Maths");
     var student = new Student("unnamed", Student.MinValidId);
     student.JoinCourse(course);
     Assert.AreEqual(1, course.Students.Count);
 }
开发者ID:tddold,项目名称:TelerikAcademy-5,代码行数:7,代码来源:CourseTests.cs

示例4: StudentProperlyJoinsCourse

        public void StudentProperlyJoinsCourse()
        {
            var student = new Student("pesho", 22222);
            var course = new Course("math");
            student.JoinCourse(course);

            Assert.IsTrue(course.Students.Contains(student), "Student is not added to course");
        }
开发者ID:,项目名称:,代码行数:8,代码来源:

示例5: CourseShouldThrowIfStudentsAreMoreThanMaxAllowed

 public void CourseShouldThrowIfStudentsAreMoreThanMaxAllowed()
 {
     var course = new Course("Maths");
     for (int i = 0; i <= Course.MaxStudentsCount; i++)
     {
         var student = new Student("unnamed", Student.MinValidId+i);
         student.JoinCourse(course);
     }
 }
开发者ID:tddold,项目名称:TelerikAcademy-5,代码行数:9,代码来源:CourseTests.cs

示例6: StudentProperlyLeavesCourse

        public void StudentProperlyLeavesCourse()
        {
            var student = new Student("pesho", 22222);
            var course = new Course("math");
            student.JoinCourse(course);
            student.LeaveCourse(course);

            Assert.IsFalse(course.Students.Contains(student), "Student is still in the course");
        }
开发者ID:,项目名称:,代码行数:9,代码来源:

示例7: Course_AddingMoreThan29Students

        public void Course_AddingMoreThan29Students()
        {
            School mySchool = new School();
            Course art = new Course();

            for (int i = 1; i <= 35; i++)
            {
                Student student = new Student("Ivan Ivanov", i + 10000, mySchool);
                student.JoinCourse(art);
            }

            Assert.Fail("Course takes only 29 students");
        }
开发者ID:NikolovNikolay,项目名称:Telerik-Homeworks,代码行数:13,代码来源:SchoolTests.cs

示例8: StudentGroupShouldAddOnlyNewNotAlreadyAddedStudentsFromNewCourseOnNewCourseAdd

        public void StudentGroupShouldAddOnlyNewNotAlreadyAddedStudentsFromNewCourseOnNewCourseAdd()
        {
            var myClass = new StudentGroup("TelerikAcad");
            var newCourse = new Course("HQC");
            var existingStudent = new Student("Existing Guy", Student.MinValidId);
            var newStudent = new Student("New Guy", Student.MinValidId+1);
            newStudent.JoinCourse(newCourse);
            myClass.AddStudent(existingStudent);

            myClass.AddCourse(newCourse);

            Assert.AreEqual(2, myClass.Students.Count);
        }
开发者ID:tddold,项目名称:TelerikAcademy-5,代码行数:13,代码来源:SchoolTests.cs

示例9: Course_LeavingCourse

        public void Course_LeavingCourse()
        {
            School mySchool = new School();
            Course art = new Course();

            for (int i = 1; i <= 15; i++)
            {
                Student student = new Student("Ivan Ivanov", i + 10000, mySchool);
                student.JoinCourse(art);
                student.LeaveCourse(art);
            }

            Assert.IsTrue(art.Members.Count == 0);
        }
开发者ID:NikolovNikolay,项目名称:Telerik-Homeworks,代码行数:14,代码来源:SchoolTests.cs

示例10: StudentSHouldThrowWehnJoiningNullCourse

 public void StudentSHouldThrowWehnJoiningNullCourse()
 {
     var st = new Student("Pesho", 15000);
     st.JoinCourse(null);
 }
开发者ID:tddold,项目名称:TelerikAcademy-5,代码行数:5,代码来源:StudentTests.cs

示例11: Student_JoinCourse

 public void Student_JoinCourse()
 {
     School mySchool = new School();
     Course biology = new Course();
     Student gosho = new Student("gosho", 48000, mySchool);
     gosho.JoinCourse(biology);
 }
开发者ID:NikolovNikolay,项目名称:Telerik-Homeworks,代码行数:7,代码来源:SchoolTests.cs

示例12: StudentCanNotJoinNullCourse

 public void StudentCanNotJoinNullCourse()
 {
     var student = new Student("pesho", 22222);
     student.JoinCourse(null);
 }
开发者ID:,项目名称:,代码行数:5,代码来源:


注:本文中的School.Student.JoinCourse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。