本文整理汇总了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));
}
示例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");
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}