Browse Source

Test: AddAdmin Test added

remotes/origin/fdai7780
fdai7600 11 months ago
parent
commit
ba5399d675
  1. 26
      src/test/java/org/example/AdministrationTest.java

26
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.");
}
}
Loading…
Cancel
Save