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


C# Course.AddStudent方法代码示例

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


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

示例1: CourseShouldThrowExceptionWhenExistingStudentAdded

 public void CourseShouldThrowExceptionWhenExistingStudentAdded()
 {
     var course = new Course("Test Course");
     Student student = new Student("Jane Dow", 10000);
     course.AddStudent(student);
     course.AddStudent(student);
 }
开发者ID:Vyara,项目名称:Telerik-High-Quality-Code-Homeworks,代码行数:7,代码来源:CourseTest.cs

示例2: CourseShouldThrowExceptionWhenExistingStudentAdded

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

示例3: Course_CourseAllowsDuplicateIDs

        public void Course_CourseAllowsDuplicateIDs()
        {
            Course mathCourse = new Course("math");

            mathCourse.AddStudent(new Student("Gosho", 12345));
            mathCourse.AddStudent(new Student("Pesho", 12345));
        }
开发者ID:Cecosam,项目名称:Csharp-Projects,代码行数:7,代码来源:CourseTest.cs

示例4: CourseShouldThrowAnApplicationExceptionWhenTheSameStudentIsAddedMoreThanOnce

 public void CourseShouldThrowAnApplicationExceptionWhenTheSameStudentIsAddedMoreThanOnce()
 {
     Course testCourse = new Course("Test");
     Student testStudent = new Student("a");
     testCourse.AddStudent(testStudent);
     testCourse.AddStudent(testStudent);
 }
开发者ID:SimoPrG,项目名称:TelerikAcademyHomeworks,代码行数:7,代码来源:CourseTest.cs

示例5: CourseShouldThrowWhenExistingStudentAdded

 public void CourseShouldThrowWhenExistingStudentAdded()
 {
     var course = new Course("C#");
     Student student = new Student("John", "Doe", 10000);
     course.AddStudent(student);
     course.AddStudent(student);
 }
开发者ID:MarinaGeorgieva,项目名称:TelerikAcademy,代码行数:7,代码来源:CourseTests.cs

示例6: Course_AddSExistingStudentExceptionTest

 public void Course_AddSExistingStudentExceptionTest()
 {
     Student testStudent = new Student("Pesho", 11111);
     Course testCourse = new Course("CSharp");
     testCourse.AddStudent(testStudent);
     testCourse.AddStudent(testStudent);
 }
开发者ID:kris4o1993,项目名称:Telerik-Academy,代码行数:7,代码来源:CourseTest.cs

示例7: CourseShouldThrowExceptionWhenExistingStudentAdded

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

示例8: AddingStudentInCourseShouldWorkProperly

 public void AddingStudentInCourseShouldWorkProperly()
 {
     var course = new Course("asdad");
     course.AddStudent(new Student("Jigubigulq", 12312));
     course.AddStudent(new Student("Jigubigulq", 12321));
     Assert.AreEqual(2, course.Students.Count, "Course is not adding students properly!");
 }
开发者ID:NK-Hertz,项目名称:Telerik-Academy-2015,代码行数:7,代码来源:StudentAndCoursesTests.cs

示例9: AddTheSameStudent_AddTheSameStudentInCourse_ShouldThrowInvalidOperationException

 public void AddTheSameStudent_AddTheSameStudentInCourse_ShouldThrowInvalidOperationException()
 {
     var student = new Student("Telerik", 9);
     Course course = new Course();
     course.AddStudent(student);
     course.AddStudent(student);
 }
开发者ID:deskuuu,项目名称:TelerikAcademy,代码行数:7,代码来源:CourseTests.cs

示例10: AddingExistingStudentShouldThrow

 public void AddingExistingStudentShouldThrow()
 {
     Course course = new Course("Batman trainig 101");
     Student newStudent = new Student("Stamat", 10000);
     course.AddStudent(newStudent);
     course.AddStudent(newStudent);
 }
开发者ID:Rostech,项目名称:TelerikAcademyHomeworks,代码行数:7,代码来源:CourseTests.cs

示例11: CourseShouldThrowWhenAddedStudentAlreadyExists

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

            highQualityCode.AddStudent(gosho);
            highQualityCode.AddStudent(gosho);
        }
开发者ID:atanas-georgiev,项目名称:TelerikAcademy-1,代码行数:8,代码来源:CourseTests.cs

示例12: CourseShouldThrowAnExceptionWhenExistingStudentIsAdded

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

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

示例13: TestAddSameStudents

		public void TestAddSameStudents()
		{
			Student georgi = new Student("Georgi Georgiev", 12345);
			Student boiko = new Student("Georgi Georgiev", 12345);
			Course course = new Course("PHP");
			course.AddStudent(georgi);
			course.AddStudent(boiko);
		}
开发者ID:damy90,项目名称:Telerik-all,代码行数:8,代码来源:CourseTests.cs

示例14: TestDuplicateStudentInCourse

    public void TestDuplicateStudentInCourse()
    {
        Course course = new Course();
        Student student = new Student("Pesho", 50000);

        course.AddStudent(student);
        course.AddStudent(student);
    }
开发者ID:sabrie,项目名称:TelerikAcademy,代码行数:8,代码来源:CourseTests.cs

示例15: ExpectedToThrowWhenAddingSameStudentToCourse

        public void ExpectedToThrowWhenAddingSameStudentToCourse()
        {
            var course = new Course("C#");
            var student = new Student("Pesho", 55555);

            course.AddStudent(student);
            course.AddStudent(student);
        }
开发者ID:DimitarGaydardzhiev,项目名称:TelerikAcademy,代码行数:8,代码来源:CourseTests.cs


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