diff --git a/src/test/java/org/example/AdministrationTest.java b/src/test/java/org/example/AdministrationTest.java index fdff1bb..6ec59c3 100644 --- a/src/test/java/org/example/AdministrationTest.java +++ b/src/test/java/org/example/AdministrationTest.java @@ -19,6 +19,16 @@ class AdministrationTest { } + @Test + void deleteProfessor() { + Administration administration = new Administration(); + Professor professor = new Professor("P1002", "Diana", "Professor"); + + administration.addProfessor(professor); + assertTrue(administration.deleteProfessor("P1002")); + assertNull(administration.findProfessorById("P1002")); + } + @Test void testAddProfessor() { Administration administration = new Administration(); @@ -85,15 +95,19 @@ class AdministrationTest { Student student2 = administration.findStudentById("S1001"); assertEquals(student, student2); } - @Test - void deleteProfessor() { + void addAdminTest() { Administration administration = new Administration(); - Professor professor = new Professor("P1002", "Diana", "Professor"); - administration.addProfessor(professor); - assertTrue(administration.deleteProfessor("P1002")); - assertNull(administration.findProfessorById("P1002")); + Admin admin = new Admin("Jane Doe", "A2001", "Admin"); + administration.addAdmin(admin); + Admin result = administration.findAdminById("A2001"); + + assertNotNull(result, "Admin should be found after being added."); + assertEquals("A2001", result.getId(), "The ID of the found admin should match."); + assertEquals("Jane Doe", result.getName(), "The name of the found admin should match."); } + + } \ No newline at end of file