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