From 4b91590ea71e71ba05ed41299b10e82fc9669008 Mon Sep 17 00:00:00 2001 From: fdai7600 Date: Wed, 7 Feb 2024 16:07:46 +0100 Subject: [PATCH] Test: findAdminByIdTest Test added --- src/test/java/org/example/AdministrationTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/test/java/org/example/AdministrationTest.java b/src/test/java/org/example/AdministrationTest.java index 6ec59c3..1eb2203 100644 --- a/src/test/java/org/example/AdministrationTest.java +++ b/src/test/java/org/example/AdministrationTest.java @@ -108,6 +108,15 @@ class AdministrationTest { assertEquals("Jane Doe", result.getName(), "The name of the found admin should match."); } + @Test + void findAdminByIdTest() { + Administration administration = new Administration(); + Admin admin = new Admin("John Doe", "A2002", "Admin"); + administration.addAdmin(admin); + Admin result = administration.findAdminById("A2002"); + assertNotNull(result, "Admin should be found by ID."); + assertEquals("A2002", result.getId(), "The ID should match the one searched for."); + } } \ No newline at end of file