本文整理汇总了C#中School.Student.JoinCourse方法的典型用法代码示例。如果您正苦于以下问题:C# Student.JoinCourse方法的具体用法?C# Student.JoinCourse怎么用?C# Student.JoinCourse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类School.Student
的用法示例。
在下文中一共展示了Student.JoinCourse方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CourseShouldThrowIfStudentAlreadyAdded
public void CourseShouldThrowIfStudentAlreadyAdded()
{
var course = new Course("Maths");
var student = new Student("unnamed", Student.MinValidId);
student.JoinCourse(course);
student.JoinCourse(course);
}
示例2: StudentShouldNotThrowWhenLeavingCourse
public void StudentShouldNotThrowWhenLeavingCourse()
{
var course = new Course("testCourse");
var st = new Student("Pesho", 15000);
st.JoinCourse(course);
st.LeaveCourse(course);
}
示例3: CourseShouldAddStudent
public void CourseShouldAddStudent()
{
var course = new Course("Maths");
var student = new Student("unnamed", Student.MinValidId);
student.JoinCourse(course);
Assert.AreEqual(1, course.Students.Count);
}
示例4: StudentProperlyJoinsCourse
public void StudentProperlyJoinsCourse()
{
var student = new Student("pesho", 22222);
var course = new Course("math");
student.JoinCourse(course);
Assert.IsTrue(course.Students.Contains(student), "Student is not added to course");
}
示例5: CourseShouldThrowIfStudentsAreMoreThanMaxAllowed
public void CourseShouldThrowIfStudentsAreMoreThanMaxAllowed()
{
var course = new Course("Maths");
for (int i = 0; i <= Course.MaxStudentsCount; i++)
{
var student = new Student("unnamed", Student.MinValidId+i);
student.JoinCourse(course);
}
}
示例6: StudentProperlyLeavesCourse
public void StudentProperlyLeavesCourse()
{
var student = new Student("pesho", 22222);
var course = new Course("math");
student.JoinCourse(course);
student.LeaveCourse(course);
Assert.IsFalse(course.Students.Contains(student), "Student is still in the course");
}
示例7: Course_AddingMoreThan29Students
public void Course_AddingMoreThan29Students()
{
School mySchool = new School();
Course art = new Course();
for (int i = 1; i <= 35; i++)
{
Student student = new Student("Ivan Ivanov", i + 10000, mySchool);
student.JoinCourse(art);
}
Assert.Fail("Course takes only 29 students");
}
示例8: StudentGroupShouldAddOnlyNewNotAlreadyAddedStudentsFromNewCourseOnNewCourseAdd
public void StudentGroupShouldAddOnlyNewNotAlreadyAddedStudentsFromNewCourseOnNewCourseAdd()
{
var myClass = new StudentGroup("TelerikAcad");
var newCourse = new Course("HQC");
var existingStudent = new Student("Existing Guy", Student.MinValidId);
var newStudent = new Student("New Guy", Student.MinValidId+1);
newStudent.JoinCourse(newCourse);
myClass.AddStudent(existingStudent);
myClass.AddCourse(newCourse);
Assert.AreEqual(2, myClass.Students.Count);
}
示例9: Course_LeavingCourse
public void Course_LeavingCourse()
{
School mySchool = new School();
Course art = new Course();
for (int i = 1; i <= 15; i++)
{
Student student = new Student("Ivan Ivanov", i + 10000, mySchool);
student.JoinCourse(art);
student.LeaveCourse(art);
}
Assert.IsTrue(art.Members.Count == 0);
}
示例10: StudentSHouldThrowWehnJoiningNullCourse
public void StudentSHouldThrowWehnJoiningNullCourse()
{
var st = new Student("Pesho", 15000);
st.JoinCourse(null);
}
示例11: Student_JoinCourse
public void Student_JoinCourse()
{
School mySchool = new School();
Course biology = new Course();
Student gosho = new Student("gosho", 48000, mySchool);
gosho.JoinCourse(biology);
}
示例12: StudentCanNotJoinNullCourse
public void StudentCanNotJoinNullCourse()
{
var student = new Student("pesho", 22222);
student.JoinCourse(null);
}