Beispiel #1
0
 public void SignOutStudentOfCourse_SighOutUnexistingStudentOfCourse()
 {
     School theSchool = new School();
     Course newCourse = theSchool.AddNewCourse("CSharp");
     theSchool.SignOutStudentOfCourse(10000, newCourse.Name);
 }
Beispiel #2
0
 public void SignOutStudentOfCourse_SighStudentOfUnexistingCourse()
 {
     School theSchool = new School();
     Student newStudent = theSchool.AddNewStudent("Pesho");
     theSchool.SignOutStudentOfCourse(newStudent.Id, "CSharp");
 }
Beispiel #3
0
        public void SignOutStudentOfCourse_SighOutOneStudentOfOneCourse()
        {
            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));

            theSchool.SignOutStudentOfCourse(newStudent.Id, newCourse.Name);

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