|
|
@ -135,4 +135,20 @@ class AdministrationTest { |
|
|
|
assertEquals("Alice", administration.findStudentById("S1001").getName()); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
void deleteStudentTest() { |
|
|
|
Administration administration = new Administration(); |
|
|
|
Student student = new Student("Bob", "S1002", "Student"); |
|
|
|
|
|
|
|
// Add the student and verify they're added |
|
|
|
administration.addStudents(student); |
|
|
|
assertNotNull(administration.findStudentById("S1002")); |
|
|
|
|
|
|
|
// Delete the student |
|
|
|
assertTrue(administration.deleteStudents("S1002")); |
|
|
|
|
|
|
|
// Verify the student is no longer found |
|
|
|
assertNull(administration.findStudentById("S1002")); |
|
|
|
} |
|
|
|
|
|
|
|
} |