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