diff --git a/src/test/java/org/example/AdministrationTest.java b/src/test/java/org/example/AdministrationTest.java index c8b7836..fdff1bb 100644 --- a/src/test/java/org/example/AdministrationTest.java +++ b/src/test/java/org/example/AdministrationTest.java @@ -17,8 +17,22 @@ class AdministrationTest { Professor foundProf1 = administration.findProfessorById("P1001"); assertEquals(prof1, foundProf1); + } + + @Test + void testAddProfessor() { + Administration administration = new Administration(); + + Professor newProfessor = new Professor("P2001", "Dr. Jane Smith", "Professor"); + + administration.addProfessor(newProfessor); + Professor retrievedProfessor = administration.findProfessorById("P2001"); + assertNotNull(retrievedProfessor, "Professor should be found in the administration."); + assertEquals(newProfessor.getProfessorID(), retrievedProfessor.getProfessorID(), "The retrieved professor's ID should match the original."); + assertEquals(newProfessor.getName(), retrievedProfessor.getName(), "The retrieved professor's name should match the original."); + assertEquals(newProfessor.getRole(), retrievedProfessor.getRole(), "The retrieved professor's role should match the original."); } @Test