public static void MyClassInitialize(TestContext testContext) { testUniver = new University("Test Uni"); testGroup = new Group("TestGroup"); testGroup.AddStudent(new Student("Mr. Brilliant")); testGroup.AddStudent(new Student("Mr. Diamond")); testGroup.AddStudent(new Student("Mr. Carbone")); testUniver.AddGroup(testGroup); testTeacher = new Teacher("Mr. Smartpants"); testCourse = new Course("Very hard course"); testUniver.AddCourse(testCourse); testTeacher.AddCourse(testCourse); }
/// <summary> /// Removes the link to the course. /// Course stays in the Storage /// </summary> /// <param name="group"></param> public void RemoveCourse(Course course) { course.UniverID = string.Empty; }
public void RemoveCourse(Course c) { c.TeacherID = string.Empty; }
/// <summary> /// Sets the link between this university and passed course. /// Also tries to add a course to the Storage if nessesary /// </summary> /// <param name="group">Course being linked to the university</param> public void AddCourse(Course course) { if (Storage.Data.Courses.GetItem(course.ID) == null) Storage.Data.Courses.AddItem(course); course.UniverID = ID; }
public void AddCourse(Course c) { if (Storage.Data.Courses.GetItem(c.ID) == null) Storage.Data.Courses.AddItem(c); c.TeacherID = ID; }