本文整理汇总了C#中Student.UnsignCourse方法的典型用法代码示例。如果您正苦于以下问题:C# Student.UnsignCourse方法的具体用法?C# Student.UnsignCourse怎么用?C# Student.UnsignCourse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student
的用法示例。
在下文中一共展示了Student.UnsignCourse方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StudentShouldBeAbleToCorrectlyRemoveCourse
public void StudentShouldBeAbleToCorrectlyRemoveCourse()
{
var student = new Student("Goshko");
var course = new Course("Goshko's course");
student.SignCourse(course);
student.UnsignCourse(course);
Assert.IsFalse(student.Courses.Contains(course));
}
示例2: StudentShouldBeAbleToCorrectlyRemoveALotOfCourses
public void StudentShouldBeAbleToCorrectlyRemoveALotOfCourses()
{
var student = new Student("Goshko");
var listOFCourses = new List<Course>();
for (int i = 0; i < 250; i++)
{
var course = new Course("Name: " + i);
student.SignCourse(course);
listOFCourses.Add(course);
}
foreach (var course in listOFCourses)
{
student.UnsignCourse(course);
}
Assert.IsTrue(student.Courses.Count == 0, "All courses should be removed");
}
示例3: StudentShouldThrowWhileTryingToRemoveCourseThatHasNotBeenSigned
public void StudentShouldThrowWhileTryingToRemoveCourseThatHasNotBeenSigned()
{
var student = new Student("Goshko");
var course = new Course("Ivanchov's course");
student.UnsignCourse(course);
}
示例4: StudentShouldThrowWhileRemovingANullCourse
public void StudentShouldThrowWhileRemovingANullCourse()
{
var student = new Student("Goshko");
student.UnsignCourse(null);
}
示例5: StudentShouldUnsignCourseCorrectly
public void StudentShouldUnsignCourseCorrectly()
{
var student = new Student("John", "Doe", 12345);
var course = new Course("C#");
student.SignCourse(course);
Assert.IsTrue(student.Courses.Contains(course));
student.UnsignCourse(course);
Assert.IsFalse(student.Courses.Contains(course));
Assert.IsFalse(course.Students.Contains(student));
}
示例6: StudentShouldThrowWhenUnsigningNullCourse
public void StudentShouldThrowWhenUnsigningNullCourse()
{
var student = new Student("John", "Doe", 12345);
Course course = null;
student.UnsignCourse(course);
}