|
|
@ -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."); |
|
|
|
} |
|
|
|
} |