|
@ -8,6 +8,7 @@ import java.io.ByteArrayOutputStream; |
|
|
import java.io.PrintStream; |
|
|
import java.io.PrintStream; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
|
|
|
|
import java.util.Scanner; |
|
|
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.*; |
|
|
import static org.junit.jupiter.api.Assertions.*; |
|
|
|
|
|
|
|
@ -514,6 +515,22 @@ class AdministrationTest { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void deleteCourseWithInput(){ |
|
|
|
|
|
Course course = sampleCourse; |
|
|
|
|
|
admin.addCourse(course); |
|
|
|
|
|
String courseIDToDelete = course.getCourseID(); |
|
|
|
|
|
|
|
|
|
|
|
boolean isDeleted = admin.deleteCourse(courseIDToDelete); |
|
|
|
|
|
if (isDeleted) { |
|
|
|
|
|
System.out.println("Course with ID " + courseIDToDelete + " has been successfully deleted."); |
|
|
|
|
|
} else { |
|
|
|
|
|
System.out.println("Course with ID " + courseIDToDelete + " not found."); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
assertEquals(0, admin.getCourses().size()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|