Example #1
0
        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);
        }
Example #2
0
 /// <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;
 }
Example #3
0
 public void RemoveCourse(Course c)
 {
     c.TeacherID = string.Empty;
 }
Example #4
0
 /// <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;
 }
Example #5
0
 public void AddCourse(Course c)
 {
     if (Storage.Data.Courses.GetItem(c.ID) == null)
         Storage.Data.Courses.AddItem(c);
     c.TeacherID = ID;
 }