本文整理汇总了C#中School.Course类的典型用法代码示例。如果您正苦于以下问题:C# Course类的具体用法?C# Course怎么用?C# Course使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Course类属于School命名空间,在下文中一共展示了Course类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CourseShouldAddStudent
public void CourseShouldAddStudent()
{
var course = new Course("Maths");
var student = new Student("unnamed", Student.MinValidId);
student.JoinCourse(course);
Assert.AreEqual(1, course.Students.Count);
}
示例2: AddingTheSameCourseMoreThanOnce_ThrowException
public void AddingTheSameCourseMoreThanOnce_ThrowException()
{
var school = new SchoolDem("Filipovo");
var course = new Course("Alg");
school.AddCourse(course);
school.AddCourse(course);
}
示例3: CourseShouldThrowIfStudentAlreadyAdded
public void CourseShouldThrowIfStudentAlreadyAdded()
{
var course = new Course("Maths");
var student = new Student("unnamed", Student.MinValidId);
student.JoinCourse(course);
student.JoinCourse(course);
}
示例4: TestRemoveNotExistingStudent
public void TestRemoveNotExistingStudent()
{
Course css = new Course("CSS", students);
Student koko = new Student("Kaloyan", 88823);
css.RemoveStudent(koko);
}
示例5: CourseCanNotRemoveAStudentThatItDoesntHave
public void CourseCanNotRemoveAStudentThatItDoesntHave()
{
var course = new Course("math");
var student = new Student("Pesho", 12345);
course.RemoveStudent(student);
}
示例6: TestJoinCourseSuccessfully
public void TestJoinCourseSuccessfully()
{
Course course = new Course();
Student student = new Student("Valia", 34567);
string result = course.JoinCourse(student);
Assert.AreEqual("Done!", result);
}
示例7: AddStudentTwiseTest
public void AddStudentTwiseTest()
{
Course course = new Course("Math");
Student student = new Student("Gosho", "Ivanov", 12345);
course.AddStudent(student);
course.AddStudent(student);
}
示例8: AddStudentAtsCourseMethodTest
public void AddStudentAtsCourseMethodTest()
{
Course course = new Course("Math");
Student student = new Student("Gosho", "Ivanov", 12345);
course.AddStudent(student);
Assert.AreEqual(student.ID, course.ListOfStudents[0].ID);
}
示例9: StudentGroupShouldAddCourse
public void StudentGroupShouldAddCourse()
{
var myClass = new StudentGroup("TelerikAcad");
var course = new Course("HQC");
myClass.AddCourse(course);
Assert.AreEqual(1, myClass.Courses.Count);
}
示例10: TestCourseWithZeroStudents
public void TestCourseWithZeroStudents()
{
List<Student> students = new List<Student>();
Course newCourse = new Course(students);
Assert.AreEqual(0, newCourse.StudentsInCourse.Count);
}
示例11: AddingTheSameStudentMoreThanOnce_ThrowException
public void AddingTheSameStudentMoreThanOnce_ThrowException()
{
var spirt = new Course("Spirt");
var student = new Student("Peter");
spirt.AddStudent(student);
spirt.AddStudent(student);
}
示例12: NameTest
public void NameTest()
{
string name = "JavaScript";
Course target = new Course(name);
string actual = target.Name;
Assert.AreEqual(name, actual);
}
示例13: ValidateCourse
void ValidateCourse(Course course)
{
if (course == null)
{
throw new ArgumentNullException("This course is missed.");
}
}
示例14: RemoveStudentInCourse
public void RemoveStudentInCourse()
{
Course course = new Course("lala");
course.AddStudent(new Student("lol", 10000));
course.RemoveStudentByUID(10000);
course.AddStudent(new Student("lol", 10000));
}
示例15: StudentShouldNotThrowWhenLeavingCourse
public void StudentShouldNotThrowWhenLeavingCourse()
{
var course = new Course("testCourse");
var st = new Student("Pesho", 15000);
st.JoinCourse(course);
st.LeaveCourse(course);
}