From ec254257f3675072eda248d943cf7331df2b668a Mon Sep 17 00:00:00 2001 From: fdai7887 Date: Thu, 8 Feb 2024 15:51:23 +0100 Subject: [PATCH] Added test for initializeDummyData in AdministrationTest class --- .../java/org/example/AdministrationTest.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/example/AdministrationTest.java b/src/test/java/org/example/AdministrationTest.java index 6f24b85..1dc593f 100644 --- a/src/test/java/org/example/AdministrationTest.java +++ b/src/test/java/org/example/AdministrationTest.java @@ -287,4 +287,22 @@ class AdministrationTest { // Finding the added course assertEquals(course, admin.findCourseByID("M101")); } -} \ No newline at end of file + @Test + public void testInitializeDummyData(){ + admin.initializeDummyData(); + + // Check if students are initialized correctly + assertEquals(2, admin.getStudents().size()); + + // Check if professors are initialized correctly + assertEquals(2, admin.getProfessors().size()); + + // Check if admins are initialized correctly + assertEquals(2, admin.getAdmins().size()); + + // Check if courses are initialized correctly + assertEquals(2, admin.getCourses().size()); + } + + + }