Example #1
0
        public void Test_AddCourse_DisplaysAddedCourses()
        {
            Student testStudent2 = new Student("Bob", enrollmentDate);
              testStudent2.Save();
              Course testCourse = new Course("CS101", 1);
              testCourse.Save();

              testStudent2.AddCourse(testCourse.GetId());
              List<Course> resultList = testStudent2.GetCourses();
              List<Course> expectedList= new List<Course>{testCourse};

              Assert.Equal(expectedList, resultList);
        }
Example #2
0
        public void Test_DropCourse_DropsSelectedCourse()
        {
            Student testStudent = new Student("Bob", enrollmentDate);
              testStudent.Save();
              Course testCourse1 = new Course("CS101", 1);
              testCourse1.Save();
              testStudent.AddCourse(testCourse1.GetId());
              Course testCourse2 = new Course("PHIL101", 2);
              testCourse2.Save();
              testStudent.AddCourse(testCourse2.GetId());

              testStudent.DropCourse(testCourse1.GetId());

              List<Course> resultList = testStudent.GetCourses();
              List<Course> expectedList= new List<Course>{testCourse2};

              Assert.Equal(expectedList, resultList);
        }