|
|
@ -79,4 +79,19 @@ class AdministrationTest { |
|
|
|
admin.addCourse(course); |
|
|
|
assertEquals(course, admin.findCourseByID("M101")); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testDeleteCourse() { |
|
|
|
Administration administration = new Administration(); |
|
|
|
// Adding a course |
|
|
|
Course course = new Course("Math", "M101", 4); |
|
|
|
administration.addCourse(course); |
|
|
|
|
|
|
|
// Deleting the course |
|
|
|
assertTrue(administration.deleteCourse("M101")); |
|
|
|
|
|
|
|
// Checking if the course is no longer found |
|
|
|
assertNull(administration.findCourseByID("M101")); |
|
|
|
} |
|
|
|
|
|
|
|
} |