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


C# Student.AttendCourse方法代码示例

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


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

示例1: StudentShouldNotThrowExceptionWhenLeavesCourse

 public void StudentShouldNotThrowExceptionWhenLeavesCourse()
 {
     var student = new Student("Jimmy Hendrix", 10000);
     var course = new Course("Music");
     student.AttendCourse(course);
     student.LeaveCourse(course);
 }
开发者ID:ivanvasilev,项目名称:Telerik-Academy-Homeworks,代码行数: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: IfCourseArgumentInAttendCourseMethodIsNullThrowInvalidOperationException

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

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

示例4: StudentShouldAttendCoursesCorrectly

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

            gosho.AttendCourse(highQualityCode);

            Assert.IsTrue(
                highQualityCode.Students.Contains(gosho),
                "Adding a student to a course should accordingly add the student to the course's list of students.");
        }
开发者ID:atanas-georgiev,项目名称:TelerikAcademy-1,代码行数:11,代码来源:StudentTests.cs

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

示例6: StudentAttendingNullCourseShouldThrowArgumentNullException

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

示例7: StudentShouldThrowExceptionWhenAttendingNullCourse

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

示例8: StudentShouldThrowWhenAttendedCourseIsNull

        public void StudentShouldThrowWhenAttendedCourseIsNull()
        {
            Student gosho = new Student(MinValidID, "Georgi", "Petrov");

            gosho.AttendCourse(null);
        }
开发者ID:atanas-georgiev,项目名称:TelerikAcademy-1,代码行数:6,代码来源:StudentTests.cs

示例9: StudentShouldThrowExceptionWhenAttendingNullCourse

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

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

示例11: StudentShouldNotThrowExceptionWhenAttendingCourse

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


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