本文整理汇总了C#中School.Student.LeaveCourse方法的典型用法代码示例。如果您正苦于以下问题:C# Student.LeaveCourse方法的具体用法?C# Student.LeaveCourse怎么用?C# Student.LeaveCourse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类School.Student
的用法示例。
在下文中一共展示了Student.LeaveCourse方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StudentShouldNotThrowWhenLeavingCourse
public void StudentShouldNotThrowWhenLeavingCourse()
{
var course = new Course("testCourse");
var st = new Student("Pesho", 15000);
st.JoinCourse(course);
st.LeaveCourse(course);
}
示例2: CourseShouldRemoveStudent
public void CourseShouldRemoveStudent()
{
var course = new Course("Maths");
var student = new Student("unnamed", Student.MinValidId);
student.JoinCourse(course);
Assert.AreEqual(1, course.Students.Count);
student.LeaveCourse(course);
Assert.AreEqual(0, course.Students.Count);
}
示例3: 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");
}
示例4: TestLeaveCourseMethodShouldWorkProperly
public void TestLeaveCourseMethodShouldWorkProperly()
{
var testCourse = new Course("testCourseName");
var testStudent = new Student(10001, "Test Student Name");
testStudent.AttendCourse(testCourse);
testStudent.LeaveCourse(testCourse);
Assert.IsTrue(
testCourse.Students.Count == 0,
"Students list count is not equal to zero"
);
}
示例5: 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);
}
示例6: CanNotAddNullStudents
public void CanNotAddNullStudents()
{
var student = new Student("pesho", 22222);
student.LeaveCourse(null);
}
示例7: StudentSHouldThrowWhenLeavingNullCourse
public void StudentSHouldThrowWhenLeavingNullCourse()
{
var st = new Student("Pesho", 15000);
st.LeaveCourse(null);
}
示例8: CourseShouldThrowIfStudentToRemoveDoesNotExist
public void CourseShouldThrowIfStudentToRemoveDoesNotExist()
{
var course = new Course("Maths");
var student = new Student("unnamed", Student.MinValidId);
student.LeaveCourse(course);
}
示例9: StudentCanNotLeaveNullCourse
public void StudentCanNotLeaveNullCourse()
{
var student = new Student("pesho", 22222);
student.LeaveCourse(null);
}