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


C# Student.LeaveCourse方法代码示例

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


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

示例1: 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

示例2: CourseShouldRemoveStudent

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

示例3: 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,代码来源:

示例4: TestLeaveCourseMethodShouldWorkProperly

 public void TestLeaveCourseMethodShouldWorkProperly()
 {
     var testCourse = new Course("testCourseName");
     var testStudent = new Student(10001, "Test Student Name");
     testStudent.AttendCourse(testCourse);
     testStudent.LeaveCourse(testCourse);
     Assert.IsTrue(
         testCourse.Students.Count == 0,
         "Students list count is not equal to zero"
         );
 }
开发者ID:,项目名称:,代码行数:11,代码来源:

示例5: 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

示例6: CanNotAddNullStudents

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

示例7: StudentSHouldThrowWhenLeavingNullCourse

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

示例8: CourseShouldThrowIfStudentToRemoveDoesNotExist

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

示例9: StudentCanNotLeaveNullCourse

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


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