diff --git a/src/test/java/org/example/StudentTest.java b/src/test/java/org/example/StudentTest.java index 7dd085d..28b48b6 100644 --- a/src/test/java/org/example/StudentTest.java +++ b/src/test/java/org/example/StudentTest.java @@ -146,4 +146,14 @@ class StudentTest { assertTrue(student.hasPassed(), "Student should have passed."); } + @Test + void testStudentFails() { + Student student = new Student("Jane Doe", "S1002", "Student"); + Course history = new Course("History", "C103", 5); // Assuming 5 credits + Course biology = new Course("Biology", "C104", 5); // Assuming 5 credits + student.assignGrade(history, "8"); // Assuming grade is a String. Adjust if it's numeric. + student.assignGrade(biology, "9"); + + assertFalse(student.hasPassed(), "Student should have failed."); + } } \ No newline at end of file