From 433fe85901b9cf0ceca5451454f9523476907967 Mon Sep 17 00:00:00 2001 From: fdai7887 Date: Thu, 8 Feb 2024 23:27:00 +0100 Subject: [PATCH] Added Test for dropStudentFromCourseWithInput method to AdministrationTest class --- .../java/org/example/AdministrationTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/test/java/org/example/AdministrationTest.java b/src/test/java/org/example/AdministrationTest.java index 75cbfc4..b84df19 100644 --- a/src/test/java/org/example/AdministrationTest.java +++ b/src/test/java/org/example/AdministrationTest.java @@ -531,6 +531,25 @@ class AdministrationTest { assertEquals(0, admin.getCourses().size()); } + @Test + void dropStudentFromCourseWithInput(){ + + Student student = sampleStudent; + Course course = sampleCourse; + admin.addStudents(student); + admin.addCourse(course); + + admin.enrollStudentInCourse("S123456", "M101"); + + System.out.println("Enter Student ID:"); + String studentID = "S123456"; + System.out.println("Enter Course ID:"); + String courseID = "M101"; + admin.dropStudentFromCourse(studentID, courseID); + + assertEquals(0, student.getCourseGrades().size()); + } + }