From a28ac10f40f7360220c0dd4a64d22f1cca1134b9 Mon Sep 17 00:00:00 2001 From: fdai7921 Date: Wed, 7 Feb 2024 15:51:09 +0100 Subject: [PATCH] test: findCourseByID method in Administration class --- src/test/java/org/example/AdministrationTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/java/org/example/AdministrationTest.java b/src/test/java/org/example/AdministrationTest.java index 20e879b..b5aa94f 100644 --- a/src/test/java/org/example/AdministrationTest.java +++ b/src/test/java/org/example/AdministrationTest.java @@ -94,4 +94,15 @@ class AdministrationTest { assertNull(administration.findCourseByID("M101")); } + @Test + public void testFindCourseByID() { + Administration administration = new Administration(); + // Adding a course + Course course = new Course("Math", "M101", 4); + administration.addCourse(course); + + // Finding the added course + assertEquals(course, administration.findCourseByID("M101")); + } + } \ No newline at end of file