From 5906a08c1b72ab3ad15fc9ba050d0fcdc6f35d30 Mon Sep 17 00:00:00 2001 From: fdai7887 Date: Thu, 8 Feb 2024 17:04:33 +0100 Subject: [PATCH] refactoring: delete redundant functions in AdministrationTest class --- .../java/org/example/AdministrationTest.java | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/src/test/java/org/example/AdministrationTest.java b/src/test/java/org/example/AdministrationTest.java index 46daa26..819012e 100644 --- a/src/test/java/org/example/AdministrationTest.java +++ b/src/test/java/org/example/AdministrationTest.java @@ -154,37 +154,6 @@ class AdministrationTest { assertEquals("A2002", result.getAdminId(), "The ID should match the one searched for."); } - @Test - void addStudentTest() { - Administration administration = new Administration(); - Student student = new Student("Alice", "S1001", "Student"); - - // Initially, no student should be found - assertNull(administration.findStudentById("S1001")); - - // Add the student - administration.addStudents(student); - - // Now, the student should be found - assertNotNull(administration.findStudentById("S1001")); - assertEquals("Alice", administration.findStudentById("S1001").getStudentName()); - } - - @Test - void testDeleteStudent() { - 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")); - } /** * Test method for {@link Administration#addStudents(Student)}.