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


C# Course.AddStudent方法代码示例

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


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

示例1: RemoveStudentInCourse

 public void RemoveStudentInCourse()
 {
     Course course = new Course("lala");
     course.AddStudent(new Student("lol", 10000));
     course.RemoveStudentByUID(10000);
     course.AddStudent(new Student("lol", 10000));
 }
开发者ID:Dyno1990,项目名称:TelerikAcademy-1,代码行数:7,代码来源:CourseTests.cs

示例2: AddingTheSameStudentMoreThanOnce_ThrowException

 public void AddingTheSameStudentMoreThanOnce_ThrowException()
 {
     var spirt = new Course("Spirt");
     var student = new Student("Peter");
     spirt.AddStudent(student);
     spirt.AddStudent(student);
 }
开发者ID:Bvaptsarov,项目名称:Homework,代码行数:7,代码来源:CourseTest.cs

示例3: Main

        private static void Main()
        {
            try
            {
                Student pesho = new Student("Pesho Georgiev");
                Student gosho = new Student("Gosho Ivanov");
                Student misho = new Student("Misho Cekov");
                Student sasho = new Student("Sasho Kostov");

                Course telerikAcademy = new Course("Telerik Academy");
                Course webProgramming = new Course("Web Programming");

                webProgramming.AddStudent(sasho);

                telerikAcademy.AddStudent(pesho);
                telerikAcademy.AddStudent(gosho);
                telerikAcademy.AddStudent(misho);

                telerikAcademy.RemoveStudent(gosho);
                Console.WriteLine(gosho.ToString() + " was removed from course.");

                Console.WriteLine("Courses:");
                Console.WriteLine(telerikAcademy);

                School freeSchool = new School("School of Computer Sciences");
                freeSchool.AddCourse(webProgramming);
                freeSchool.AddCourse(telerikAcademy);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
开发者ID:niki-funky,项目名称:Telerik_Academy,代码行数:33,代码来源:Demo.cs

示例4: AddStudentTwiseTest

 public void AddStudentTwiseTest()
 {
     Course course = new Course("Math");
     Student student = new Student("Gosho", "Ivanov", 12345);
     course.AddStudent(student);
     course.AddStudent(student);
 }
开发者ID:GStoykov,项目名称:TelerikAcademyHomeworks,代码行数:7,代码来源:CourseTest.cs

示例5: TestAddStudentException

 public void TestAddStudentException()
 {
     Course html = new Course("HTML", students);
     Student pesho = new Student("Peter", 29345);
     Student gosho = new Student("Georgi", 99922);
     html.AddStudent(pesho);
     html.AddStudent(gosho);
 }
开发者ID:VyaraGGeorgieva,项目名称:TelerikAcademy,代码行数:8,代码来源:CourseTest.cs

示例6: CourseCanNotContainAStudentMoreThanOnce

        public void CourseCanNotContainAStudentMoreThanOnce()
        {
            var course = new Course("math");
            var student = new Student("Pesho", 12345);

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

示例7: CourseAddingAnAlreadyExistingStudentShouldThrow

        public void CourseAddingAnAlreadyExistingStudentShouldThrow()
        {
            var course = new Course("Just a course");
            var student = new Student("Captain Nemo", 12000);

            course.AddStudent(student);
            course.AddStudent(student);
        }
开发者ID:tokera,项目名称:Telerik-Academy,代码行数:8,代码来源:TestCourse.cs

示例8: TestAddStudent4

 public void TestAddStudent4()
 {
     Course course = new Course("Telerik Academy");
     Student misho = new Student("Misho Ivanov");
     Student pesho = new Student("Pesho Ivanov");
     course.AddStudent(misho);
     course.AddStudent(pesho);
     Assert.IsTrue(course.ListOfStudents.Count == 2);
 }
开发者ID:niki-funky,项目名称:Telerik_Academy,代码行数:9,代码来源:CourseTest.cs

示例9: TestAddStudent2

 public void TestAddStudent2()
 {
     Course course = new Course("Telerik Academy");
     Student misho = new Student("Misho Ivanov");
     Student pesho = new Student("Pesho Ivanov");
     pesho.Number = misho.Number;
     course.AddStudent(misho);
     course.AddStudent(pesho);
 }
开发者ID:niki-funky,项目名称:Telerik_Academy,代码行数:9,代码来源:CourseTest.cs

示例10: AddingOneStudentTwiceShouldMakeCourseHaveOnlyOneStudent

        public void AddingOneStudentTwiceShouldMakeCourseHaveOnlyOneStudent()
        {
            var student = new Student("Pesho");
            var course = new Course();

            course.AddStudent(student);
            course.AddStudent(student);

            Assert.AreEqual(1, course.StudentsCount);
        }
开发者ID:SimoPrG,项目名称:HighQualityCodeHomework,代码行数:10,代码来源:CourseTests.cs

示例11: CourseAddingMoreThanThirtyStudentsShouldThrow

        public void CourseAddingMoreThanThirtyStudentsShouldThrow()
        {
            var course = new Course("1337 sP33cH Course");
            for (int i = 0; i < 30; i++)
            {
                course.AddStudent(new Student(string.Format("Robot P" + i + "esho" + i), 13337 + i));
            }

            course.AddStudent(new Student("Cptn Nemo", 10001));
        }
开发者ID:tokera,项目名称:Telerik-Academy,代码行数:10,代码来源:TestCourse.cs

示例12: CourseToStringTest

 public void CourseToStringTest()
 {
     var course = new Course("C# HQC");
     var pesho = new Student("Pesho", 10132);
     var gosho = new Student("Gosho", 10123);
     course.AddStudent(pesho);
     course.AddStudent(gosho);
     string expected = "Course name: C# HQC\nStudent name is: Pesho, with id: 10132\nStudent name is: Gosho, with id: 10123\n";
     string actual = course.ToString();
     Assert.AreEqual(expected, actual);
 }
开发者ID:slop3n,项目名称:TelerikAcademy,代码行数:11,代码来源:CourseTest.cs

示例13: AddStudentTestThirtyOneStudents

        public void AddStudentTestThirtyOneStudents()
        {
            List<Student> studentList = new List<Student>();
            Course courseThirtyOneStudents = new Course(studentList);
            for (int i = 0; i < 30; i++)
            {
                courseThirtyOneStudents.AddStudent(new Student("Pesho", 10000 + i));
            }

            Student studentPesho = new Student("Pesho", 10031);
            courseThirtyOneStudents.AddStudent(studentPesho);
        }
开发者ID:RobinJS,项目名称:dotNET,代码行数:12,代码来源:CourseTest.cs

示例14: CourseRemoveStudentTest

 public void CourseRemoveStudentTest()
 {
     var course = new Course("Javascript");
     var pesho = new Student("Pesho", 10131);
     var gosho = new Student("Gosho", 10132);
     course.AddStudent(pesho);
     course.AddStudent(gosho);
     course.RemoveStudent(gosho);
     var actual = course.ToString();
     var expected = "Course name: Javascript\nStudent name is: Pesho, with id: 10131\n";
     Assert.AreEqual(expected, actual);
 }
开发者ID:slop3n,项目名称:TelerikAcademy,代码行数:12,代码来源:CourseTest.cs

示例15: AddExistingStudentToCourse

        public void AddExistingStudentToCourse()
        {
            Course math = new Course("Math");
            testingSchool.AddCourse(math);
            testingCourses.Add(math);

            this.testingStudents.Add(new Student("Pesho", 10000));

            testingStudents[0].AddCourse(math);
            math.AddStudent(testingStudents[0]);
            math.AddStudent(testingStudents[0]);
        }
开发者ID:NikolaNikushev,项目名称:Lectures,代码行数:12,代码来源:StudentTest.cs


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