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