예제 #1
0
파일: SchoolTest.cs 프로젝트: elibk/KPK
 public void SignStudentForCourse_SighStudentForUnexistingCourse()
 {
     School theSchool = new School();
     Student newStudent = theSchool.AddNewStudent("Pesho");
     theSchool.SignUpStudentForCourse(newStudent.Id, "CSharp");
 }
예제 #2
0
파일: SchoolTest.cs 프로젝트: elibk/KPK
 public void SignStudentForCourse_SighUnexistingStudentForCourse()
 {
     School theSchool = new School();
     Course newCourse = theSchool.AddNewCourse("CSharp");
     theSchool.SignUpStudentForCourse(10000, newCourse.Name);
 }
예제 #3
0
파일: SchoolTest.cs 프로젝트: elibk/KPK
        public void SignStudentForCourse_SighOneStudentForOneCourse()
        {
            School theSchool = new School();
            Student newStudent = theSchool.AddNewStudent("Pesho");
            Course newCourse = theSchool.AddNewCourse("CSharp");
            theSchool.SignUpStudentForCourse(newStudent.Id, newCourse.Name);

            School myObject = theSchool;
            Type myType = typeof(School);
            FieldInfo setOfCourses = myType.GetField("courses", BindingFlags.NonPublic | BindingFlags.Instance);

            IList<Course> courses = setOfCourses.GetValue(myObject) as IList<Course>;

            Assert.IsTrue(courses[courses.IndexOf(newCourse)].IsAttendingTheCourse(newStudent));
        }