本文整理汇总了C#中Course.AddStudent方法的典型用法代码示例。如果您正苦于以下问题:C# Course.AddStudent方法的具体用法?C# Course.AddStudent怎么用?C# Course.AddStudent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Course
的用法示例。
在下文中一共展示了Course.AddStudent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CourseShouldThrowExceptionWhenExistingStudentAdded
public void CourseShouldThrowExceptionWhenExistingStudentAdded()
{
var course = new Course("Test Course");
Student student = new Student("Jane Dow", 10000);
course.AddStudent(student);
course.AddStudent(student);
}
示例2: CourseShouldThrowExceptionWhenExistingStudentAdded
public void CourseShouldThrowExceptionWhenExistingStudentAdded()
{
var course = new Course("HQC");
Student student = new Student("Nikolay Kostov", 10000);
course.AddStudent(student);
course.AddStudent(student);
}
示例3: Course_CourseAllowsDuplicateIDs
public void Course_CourseAllowsDuplicateIDs()
{
Course mathCourse = new Course("math");
mathCourse.AddStudent(new Student("Gosho", 12345));
mathCourse.AddStudent(new Student("Pesho", 12345));
}
示例4: CourseShouldThrowAnApplicationExceptionWhenTheSameStudentIsAddedMoreThanOnce
public void CourseShouldThrowAnApplicationExceptionWhenTheSameStudentIsAddedMoreThanOnce()
{
Course testCourse = new Course("Test");
Student testStudent = new Student("a");
testCourse.AddStudent(testStudent);
testCourse.AddStudent(testStudent);
}
示例5: CourseShouldThrowWhenExistingStudentAdded
public void CourseShouldThrowWhenExistingStudentAdded()
{
var course = new Course("C#");
Student student = new Student("John", "Doe", 10000);
course.AddStudent(student);
course.AddStudent(student);
}
示例6: Course_AddSExistingStudentExceptionTest
public void Course_AddSExistingStudentExceptionTest()
{
Student testStudent = new Student("Pesho", 11111);
Course testCourse = new Course("CSharp");
testCourse.AddStudent(testStudent);
testCourse.AddStudent(testStudent);
}
示例7: CourseShouldThrowExceptionWhenExistingStudentAdded
public void CourseShouldThrowExceptionWhenExistingStudentAdded()
{
var course = new Course("HQC");
Student student = new Student("Pesho", 55555);
course.AddStudent(student);
course.AddStudent(student);
}
示例8: AddingStudentInCourseShouldWorkProperly
public void AddingStudentInCourseShouldWorkProperly()
{
var course = new Course("asdad");
course.AddStudent(new Student("Jigubigulq", 12312));
course.AddStudent(new Student("Jigubigulq", 12321));
Assert.AreEqual(2, course.Students.Count, "Course is not adding students properly!");
}
示例9: AddTheSameStudent_AddTheSameStudentInCourse_ShouldThrowInvalidOperationException
public void AddTheSameStudent_AddTheSameStudentInCourse_ShouldThrowInvalidOperationException()
{
var student = new Student("Telerik", 9);
Course course = new Course();
course.AddStudent(student);
course.AddStudent(student);
}
示例10: AddingExistingStudentShouldThrow
public void AddingExistingStudentShouldThrow()
{
Course course = new Course("Batman trainig 101");
Student newStudent = new Student("Stamat", 10000);
course.AddStudent(newStudent);
course.AddStudent(newStudent);
}
示例11: CourseShouldThrowWhenAddedStudentAlreadyExists
public void CourseShouldThrowWhenAddedStudentAlreadyExists()
{
Course highQualityCode = new Course("High quality code");
Student gosho = new Student(10000, "Georgi", "Petrov");
highQualityCode.AddStudent(gosho);
highQualityCode.AddStudent(gosho);
}
示例12: CourseShouldThrowAnExceptionWhenExistingStudentIsAdded
public void CourseShouldThrowAnExceptionWhenExistingStudentIsAdded()
{
var course = new Course("CSharp");
Student student = new Student("Georgi", "Georgiev", 12000);
course.AddStudent(student);
course.AddStudent(student);
}
示例13: TestAddSameStudents
public void TestAddSameStudents()
{
Student georgi = new Student("Georgi Georgiev", 12345);
Student boiko = new Student("Georgi Georgiev", 12345);
Course course = new Course("PHP");
course.AddStudent(georgi);
course.AddStudent(boiko);
}
示例14: TestDuplicateStudentInCourse
public void TestDuplicateStudentInCourse()
{
Course course = new Course();
Student student = new Student("Pesho", 50000);
course.AddStudent(student);
course.AddStudent(student);
}
示例15: ExpectedToThrowWhenAddingSameStudentToCourse
public void ExpectedToThrowWhenAddingSameStudentToCourse()
{
var course = new Course("C#");
var student = new Student("Pesho", 55555);
course.AddStudent(student);
course.AddStudent(student);
}