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