public void Test_AddMajor_DisplaysAddedMajors() { Student testStudent = new Student("Bob", enrollmentDate); testStudent.Save(); Department testDepartment = new Department("History"); testDepartment.Save(); testStudent.AddMajor(testDepartment.GetId()); List<Department> resultList = testStudent.GetMajors(); List<Department> expectedList= new List<Department>{testDepartment}; Assert.Equal(expectedList, resultList); }
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); }