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


C# School.CreateStudent方法代码示例

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


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

示例1: AddStudent

        public void AddStudent()
        {
            School school = new School("test");

            var student = school.CreateStudent("Kiro");
            school.AddStudent(student);

            Assert.IsTrue(school.ContainsStudent(student));
        }
开发者ID:tddold,项目名称:Telerik-Academy-3,代码行数:9,代码来源:SchoolTest.cs

示例2: AddStudentWhenCourseIsntFull

        public void AddStudentWhenCourseIsntFull()
        {
            School school = new School("test-school");
            Course course = new Course("Test");
            Student student = school.CreateStudent("ivan");

            course.School = school;
            school.AddStudent(student);
            course.AddStudent(student);

            Assert.IsTrue(course.Students.Contains(student), "Student isn't add");
        }
开发者ID:tddold,项目名称:Telerik-Academy-3,代码行数:12,代码来源:CourseTest.cs

示例3: AddStudentWhenCourseIsFull

        public void AddStudentWhenCourseIsFull()
        {
            School school = new School("test-school");
            Course course = new Course("Test");

            course.School = school;

            for (int i = 0; i < 31; i++)
            {
                Student student = school.CreateStudent("ivan");
                school.AddStudent(student);
                course.AddStudent(student);
            }
        }
开发者ID:tddold,项目名称:Telerik-Academy-3,代码行数:14,代码来源:CourseTest.cs

示例4: CountOfStudentInCourse

        public void CountOfStudentInCourse()
        {
            School school = new School("test-school");
            Course course = new Course("Test");

            course.School = school;

            for (int i = 0; i < 30; i++)
            {
                Student student = school.CreateStudent("ivan");
                school.AddStudent(student);
                course.AddStudent(student);
            }

            Assert.AreEqual(30, course.CountOfStudents);
        }
开发者ID:tddold,项目名称:Telerik-Academy-3,代码行数:16,代码来源:CourseTest.cs

示例5: CourseIsFull

        public void CourseIsFull()
        {
            School school = new School("test-school");
            Course course = new Course("Test");

            course.School = school;

            for (int i = 0; i < 30; i++)
            {
                Student student = school.CreateStudent("ivan");
                school.AddStudent(student);
                course.AddStudent(student);
            }

            Assert.IsTrue(course.IsFull);
        }
开发者ID:tddold,项目名称:Telerik-Academy-3,代码行数:16,代码来源:CourseTest.cs

示例6: RemoveStudentsFromCourse

        public void RemoveStudentsFromCourse()
        {
            School school = new School("test-school");
            Course course = new Course("Test");

            course.School = school;

            for (int i = 0; i < 30; i++)
            {
                Student student = school.CreateStudent("ivan");
                school.AddStudent(student);
                course.AddStudent(student);
            }

            var students = course.Students.ToList();

            foreach (var student in students)
            {
                Assert.IsTrue(course.RemoveStudent(student));
            }

            Assert.AreEqual(0, course.CountOfStudents);
        }
开发者ID:tddold,项目名称:Telerik-Academy-3,代码行数:23,代码来源:CourseTest.cs


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