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


C# Student.LeaveCourse方法代码示例

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


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

示例1: StudentShouldNotThrowExceptionWhenLeavesCourse

 public void StudentShouldNotThrowExceptionWhenLeavesCourse()
 {
     var student = new Student("Nikolay Kostov", 10000);
     var course = new Course("HQC");
     student.AttendCourse(course);
     student.LeaveCourse(course);
 }
开发者ID:b-slavov,项目名称:Telerik-Software-Academy,代码行数:7,代码来源:StudentTests.cs

示例2: StudentLeavingCourseShouldNotThrowException

 public void StudentLeavingCourseShouldNotThrowException()
 {
     Student student = new Student("Humpty Dumpty", 10000);
     Course course = new Course("Unit Testing");
     student.AttendCourse(course);
     student.LeaveCourse(course);
 }
开发者ID:studware,项目名称:Ange-Git,代码行数:7,代码来源:StudentTests.cs

示例3: IfCourseArgumentInLeaveCourseMethodIsNullThrowInvalidOperationException

        public void IfCourseArgumentInLeaveCourseMethodIsNullThrowInvalidOperationException()
        {
            string name = "Ivan Ivanov";
            int studentId = 10000;
            Course course = null;

            Student student = new Student(name, studentId);
            student.LeaveCourse(course);
        }
开发者ID:tzigy,项目名称:TelerikAcademy,代码行数:9,代码来源:StudentTest.cs

示例4: Student_LeaveCourse_ShouldLeaveStudentCorrectly

        public void Student_LeaveCourse_ShouldLeaveStudentCorrectly()
        {
            var student = new Student("Anna Mariq", 7777);
            var course = new Course();
            student.JoinCourse(course);
            student.LeaveCourse(course);

            Assert.AreEqual(0, course.Students.Count);
        }
开发者ID:deskuuu,项目名称:TelerikAcademy,代码行数:9,代码来源:StudentTests.cs

示例5: LeaveCourse_ShouldRemoveStudent_WhenHeDecidesToLeave

 public void LeaveCourse_ShouldRemoveStudent_WhenHeDecidesToLeave()
 {
     var name = "Ivan";
     var uniqueNumber = 12345;
     var student = new Student(name, uniqueNumber);
     var course = new Course();
     student.JoinCourse(course);
     student.LeaveCourse(course);
     Assert.AreEqual(0, course.Students.Count);
 }
开发者ID:todor-enikov,项目名称:TelerikAcademy,代码行数:10,代码来源:StudentClassTesting.cs

示例6: StudentShouldLeaveCoursesCorrectly

        public void StudentShouldLeaveCoursesCorrectly()
        {
            Student gosho = new Student(MinValidID, "Georgi", "Petrov");
            Course highQualityCode = new Course("High quality code");

            gosho.AttendCourse(highQualityCode);
            gosho.LeaveCourse(highQualityCode);

            Assert.AreEqual(
                0,
                highQualityCode.Students.Count,
                "Student attending a course and then leaving it should result in the same students list size for the course.");
        }
开发者ID:atanas-georgiev,项目名称:TelerikAcademy-1,代码行数:13,代码来源:StudentTests.cs

示例7: StudentLeavingNullCourseShouldThrowArgumentNullException

 public void StudentLeavingNullCourseShouldThrowArgumentNullException()
 {
     Student student = new Student("Humpty Dumpty", 10000);
     student.LeaveCourse(null);
 }
开发者ID:studware,项目名称:Ange-Git,代码行数:5,代码来源:StudentTests.cs

示例8: StudentShouldThrowExceptionWhenLeavingNullCourse

 public void StudentShouldThrowExceptionWhenLeavingNullCourse()
 {
     var student = new Student("Nikolay Kostov", 10000);
     Course course = null;
     student.LeaveCourse(course);
 }
开发者ID:b-slavov,项目名称:Telerik-Software-Academy,代码行数:6,代码来源:StudentTests.cs

示例9: StudentShouldThrowWhenLeftCourseIsNull

 public void StudentShouldThrowWhenLeftCourseIsNull()
 {
     Student gosho = new Student(MinValidID, "Georgi", "Petrov");
     gosho.LeaveCourse(null);
 }
开发者ID:atanas-georgiev,项目名称:TelerikAcademy-1,代码行数:5,代码来源:StudentTests.cs

示例10: StudentWithValidNamesAndIDShouldThrowAnExceptionWhenLeavingCourseThatIsNull

        public void StudentWithValidNamesAndIDShouldThrowAnExceptionWhenLeavingCourseThatIsNull()
        {
            var student = new Student("Georgi", "Georgiev", 20000);
            Course course = null;

            student.LeaveCourse(course);
        }
开发者ID:AYankova,项目名称:HQC,代码行数:7,代码来源:StudentTests.cs

示例11: StudentWithValidNamesAndIDShouldNotThrowAnExceptionWhenLeavingValidCourse

        public void StudentWithValidNamesAndIDShouldNotThrowAnExceptionWhenLeavingValidCourse()
        {
            var student = new Student("Georgi", "Georgiev", 20000);
            var course = new Course("CSharp");

            student.JoinCourse(course);
            student.LeaveCourse(course);
        }
开发者ID:AYankova,项目名称:HQC,代码行数:8,代码来源:StudentTests.cs

示例12: Student_LeaveNullCourse_ShouldThrowArgumentNullException

 public void Student_LeaveNullCourse_ShouldThrowArgumentNullException()
 {
     var student = new Student("Anna Mariq", 7777);
     Course course = null;
     student.LeaveCourse(course);
 }
开发者ID:deskuuu,项目名称:TelerikAcademy,代码行数:6,代码来源:StudentTests.cs

示例13: StudentShouldThrowExceptionWhenLeavingNullCourse

 public void StudentShouldThrowExceptionWhenLeavingNullCourse()
 {
     var student = new Student("Pesho", 55555);
     Course course = null;
     student.LeaveCourse(course);
 }
开发者ID:kiko81,项目名称:Teleric-Academy-Homeworks,代码行数:6,代码来源:SchoolTests.cs

示例14: StudentShouldNotThrowExceptionWhenLeavesCourse

 public void StudentShouldNotThrowExceptionWhenLeavesCourse()
 {
     var student = new Student("Pesho", 55555);
     var course = new Course("CSS");
     student.AttendCourse(course);
     student.LeaveCourse(course);
 }
开发者ID:kiko81,项目名称:Teleric-Academy-Homeworks,代码行数:7,代码来源:SchoolTests.cs


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