Browse Source

Added Test for dropStudentFromCourse method to AdministrationTest class

remotes/origin/fdai7887
fdai7887 11 months ago
parent
commit
6ca8101ffe
  1. 19
      src/test/java/org/example/AdministrationTest.java

19
src/test/java/org/example/AdministrationTest.java

@ -3,6 +3,7 @@ package org.example;
import org.junit.jupiter.api.Test;
import java.util.List;
import java.util.Map;
import static org.junit.jupiter.api.Assertions.*;
@ -418,4 +419,22 @@ class AdministrationTest {
assertEquals("Student",administration.findStudentById("S1010").getStudentRole());
}
@Test
void dropStudentFromCourse() {
Student student = sampleStudent;
Course course = sampleCourse;
admin.addStudents(student);
admin.addCourse(course);
Map<Course, String> studentCourses = student.getCourseGrades();
studentCourses.put(course, "Not Graded");
student.setCourseGrades(studentCourses);
assertEquals(1, student.courseGrades.size());
admin.dropStudentFromCourse("S123456", "M101");
assertEquals(0, student.courseGrades.size());
}
}
Loading…
Cancel
Save