Browse Source

Added Test for deleteCourseWithInput method to AdministrationTest class

remotes/origin/fdai7887
fdai7887 11 months ago
parent
commit
727be64c90
  1. 17
      src/test/java/org/example/AdministrationTest.java

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

@ -8,6 +8,7 @@ import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
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());
}
}
Loading…
Cancel
Save