本文整理汇总了C#中Student.LeaveCourse方法的典型用法代码示例。如果您正苦于以下问题:C# Student.LeaveCourse方法的具体用法?C# Student.LeaveCourse怎么用?C# Student.LeaveCourse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student
的用法示例。
在下文中一共展示了Student.LeaveCourse方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StudentShouldNotThrowExceptionWhenLeavesCourse
public void StudentShouldNotThrowExceptionWhenLeavesCourse()
{
var student = new Student("Nikolay Kostov", 10000);
var course = new Course("HQC");
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: IfCourseArgumentInLeaveCourseMethodIsNullThrowInvalidOperationException
public void IfCourseArgumentInLeaveCourseMethodIsNullThrowInvalidOperationException()
{
string name = "Ivan Ivanov";
int studentId = 10000;
Course course = null;
Student student = new Student(name, studentId);
student.LeaveCourse(course);
}
示例4: Student_LeaveCourse_ShouldLeaveStudentCorrectly
public void Student_LeaveCourse_ShouldLeaveStudentCorrectly()
{
var student = new Student("Anna Mariq", 7777);
var course = new Course();
student.JoinCourse(course);
student.LeaveCourse(course);
Assert.AreEqual(0, course.Students.Count);
}
示例5: LeaveCourse_ShouldRemoveStudent_WhenHeDecidesToLeave
public void LeaveCourse_ShouldRemoveStudent_WhenHeDecidesToLeave()
{
var name = "Ivan";
var uniqueNumber = 12345;
var student = new Student(name, uniqueNumber);
var course = new Course();
student.JoinCourse(course);
student.LeaveCourse(course);
Assert.AreEqual(0, course.Students.Count);
}
示例6: 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.");
}
示例7: StudentLeavingNullCourseShouldThrowArgumentNullException
public void StudentLeavingNullCourseShouldThrowArgumentNullException()
{
Student student = new Student("Humpty Dumpty", 10000);
student.LeaveCourse(null);
}
示例8: StudentShouldThrowExceptionWhenLeavingNullCourse
public void StudentShouldThrowExceptionWhenLeavingNullCourse()
{
var student = new Student("Nikolay Kostov", 10000);
Course course = null;
student.LeaveCourse(course);
}
示例9: StudentShouldThrowWhenLeftCourseIsNull
public void StudentShouldThrowWhenLeftCourseIsNull()
{
Student gosho = new Student(MinValidID, "Georgi", "Petrov");
gosho.LeaveCourse(null);
}
示例10: StudentWithValidNamesAndIDShouldThrowAnExceptionWhenLeavingCourseThatIsNull
public void StudentWithValidNamesAndIDShouldThrowAnExceptionWhenLeavingCourseThatIsNull()
{
var student = new Student("Georgi", "Georgiev", 20000);
Course course = null;
student.LeaveCourse(course);
}
示例11: StudentWithValidNamesAndIDShouldNotThrowAnExceptionWhenLeavingValidCourse
public void StudentWithValidNamesAndIDShouldNotThrowAnExceptionWhenLeavingValidCourse()
{
var student = new Student("Georgi", "Georgiev", 20000);
var course = new Course("CSharp");
student.JoinCourse(course);
student.LeaveCourse(course);
}
示例12: Student_LeaveNullCourse_ShouldThrowArgumentNullException
public void Student_LeaveNullCourse_ShouldThrowArgumentNullException()
{
var student = new Student("Anna Mariq", 7777);
Course course = null;
student.LeaveCourse(course);
}
示例13: StudentShouldThrowExceptionWhenLeavingNullCourse
public void StudentShouldThrowExceptionWhenLeavingNullCourse()
{
var student = new Student("Pesho", 55555);
Course course = null;
student.LeaveCourse(course);
}
示例14: StudentShouldNotThrowExceptionWhenLeavesCourse
public void StudentShouldNotThrowExceptionWhenLeavesCourse()
{
var student = new Student("Pesho", 55555);
var course = new Course("CSS");
student.AttendCourse(course);
student.LeaveCourse(course);
}