Browse Source

Test: added testStudentFails()

remotes/origin/fdai7600
fdai7600 11 months ago
parent
commit
6f0cddc9f2
  1. 10
      src/test/java/org/example/StudentTest.java

10
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.");
}
}
Loading…
Cancel
Save