|
@ -72,6 +72,10 @@ class AdministrationTest { |
|
|
assertEquals(student, student2); |
|
|
assertEquals(student, student2); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Test case for the addCourse method. |
|
|
|
|
|
* Adds a course to the Administration instance and checks if it can be found by its ID. |
|
|
|
|
|
*/ |
|
|
@Test |
|
|
@Test |
|
|
void addCourse() { |
|
|
void addCourse() { |
|
|
Administration admin = new Administration(); |
|
|
Administration admin = new Administration(); |
|
@ -80,6 +84,10 @@ class AdministrationTest { |
|
|
assertEquals(course, admin.findCourseByID("M101")); |
|
|
assertEquals(course, admin.findCourseByID("M101")); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Test case for the deleteCourse method. |
|
|
|
|
|
* Adds a course, deletes it, and checks if it's no longer found. |
|
|
|
|
|
*/ |
|
|
@Test |
|
|
@Test |
|
|
public void testDeleteCourse() { |
|
|
public void testDeleteCourse() { |
|
|
Administration administration = new Administration(); |
|
|
Administration administration = new Administration(); |
|
@ -94,6 +102,10 @@ class AdministrationTest { |
|
|
assertNull(administration.findCourseByID("M101")); |
|
|
assertNull(administration.findCourseByID("M101")); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Test case for the findCourseByID method. |
|
|
|
|
|
* Adds a course and checks if it can be found by its ID. |
|
|
|
|
|
*/ |
|
|
@Test |
|
|
@Test |
|
|
public void testFindCourseByID() { |
|
|
public void testFindCourseByID() { |
|
|
Administration administration = new Administration(); |
|
|
Administration administration = new Administration(); |
|
|