本文整理汇总了C#中Student.AttendCourse方法的典型用法代码示例。如果您正苦于以下问题:C# Student.AttendCourse方法的具体用法?C# Student.AttendCourse怎么用?C# Student.AttendCourse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student
的用法示例。
在下文中一共展示了Student.AttendCourse方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StudentShouldNotThrowExceptionWhenLeavesCourse
public void StudentShouldNotThrowExceptionWhenLeavesCourse()
{
var student = new Student("Jimmy Hendrix", 10000);
var course = new Course("Music");
student.AttendCourse(course);
student.LeaveCourse(course);
}
示例2: StudentLeavingCourseShouldNotThrowException
public void StudentLeavingCourseShouldNotThrowException()
{
Student student = new Student("Humpty Dumpty", 10000);
Course course = new Course("Unit Testing");
student.AttendCourse(course);
student.LeaveCourse(course);
}
示例3: IfCourseArgumentInAttendCourseMethodIsNullThrowInvalidOperationException
public void IfCourseArgumentInAttendCourseMethodIsNullThrowInvalidOperationException()
{
string name = "Ivan Ivanov";
int studentId = 10000;
Course course = null;
Student student = new Student(name, studentId);
student.AttendCourse(course);
}
示例4: StudentShouldAttendCoursesCorrectly
public void StudentShouldAttendCoursesCorrectly()
{
Student gosho = new Student(MinValidID, "Georgi", "Petrov");
Course highQualityCode = new Course("High quality code");
gosho.AttendCourse(highQualityCode);
Assert.IsTrue(
highQualityCode.Students.Contains(gosho),
"Adding a student to a course should accordingly add the student to the course's list of students.");
}
示例5: StudentShouldLeaveCoursesCorrectly
public void StudentShouldLeaveCoursesCorrectly()
{
Student gosho = new Student(MinValidID, "Georgi", "Petrov");
Course highQualityCode = new Course("High quality code");
gosho.AttendCourse(highQualityCode);
gosho.LeaveCourse(highQualityCode);
Assert.AreEqual(
0,
highQualityCode.Students.Count,
"Student attending a course and then leaving it should result in the same students list size for the course.");
}
示例6: StudentAttendingNullCourseShouldThrowArgumentNullException
public void StudentAttendingNullCourseShouldThrowArgumentNullException()
{
Student student = new Student("Humpty Dumpty", 10000);
student.AttendCourse(null);
}
示例7: StudentShouldThrowExceptionWhenAttendingNullCourse
public void StudentShouldThrowExceptionWhenAttendingNullCourse()
{
var student = new Student("Nikolay Kostov", 10000);
Course course = null;
student.AttendCourse(course);
}
示例8: StudentShouldThrowWhenAttendedCourseIsNull
public void StudentShouldThrowWhenAttendedCourseIsNull()
{
Student gosho = new Student(MinValidID, "Georgi", "Petrov");
gosho.AttendCourse(null);
}
示例9: StudentShouldThrowExceptionWhenAttendingNullCourse
public void StudentShouldThrowExceptionWhenAttendingNullCourse()
{
var student = new Student("Pesho", 55555);
student.AttendCourse(null);
}
示例10: StudentShouldNotThrowExceptionWhenLeavesCourse
public void StudentShouldNotThrowExceptionWhenLeavesCourse()
{
var student = new Student("Pesho", 55555);
var course = new Course("CSS");
student.AttendCourse(course);
student.LeaveCourse(course);
}
示例11: StudentShouldNotThrowExceptionWhenAttendingCourse
public void StudentShouldNotThrowExceptionWhenAttendingCourse()
{
var student = new Student("Pesho", 55555);
var course = new Course("HTML");
student.AttendCourse(course);
}