예제 #1
0
        public void Test_DropMajor_DropsSelectedMajor()
        {
            Student testStudent = new Student("Bob", enrollmentDate);
              testStudent.Save();
              Department testDepartment1 = new Department("Chinese");
              testDepartment1.Save();
              testStudent.AddMajor(testDepartment1.GetId());
              Department testDepartment2 = new Department("Spanish");
              testDepartment2.Save();
              testStudent.AddMajor(testDepartment2.GetId());

              testStudent.DropMajor(testDepartment1.GetId());

              List<Department> resultList = testStudent.GetMajors();
              List<Department> expectedList= new List<Department>{testDepartment2};

              Assert.Equal(expectedList, resultList);
        }