Browse Source

Merge branch 'master' of gitlab.cs.hs-fulda.de:fdai7600/PWN_Alpha_Dogs

remotes/origin/fdai7887
fdai7600 11 months ago
parent
commit
98f8944568
  1. 8
      src/main/java/org/example/Main.java
  2. 27
      src/test/java/org/example/AdministrationTest.java

8
src/main/java/org/example/Main.java

@ -85,15 +85,9 @@ public class Main {
// View Grades from Student
break;
case 11:
// View User
break;
case 12:
// Delete User
break;
case 13:
// View Course List
break;
case 14:
case 12:
// Exit (includes saving data in the files)
exit = true;
System.out.println("Exiting...");

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

@ -324,6 +324,33 @@ class AdministrationTest {
}
@Test
void dropProfFromCourse(){
Professor prof = sampleProf;
Course course = sampleCourse;
List<Course> courseList = prof.getCoursesTaught();
courseList.add(course);
prof.setCoursesTaught(courseList);
//The "User input" to determine the professor
String profID = prof.getProfessorID();
//Grabs the coursesTaught List from the Professor the user wants to enroll
List<Course> courseList2 = prof.getCoursesTaught();
//Assigning the course to the Prof by adding it the to the courseList
courseList2.remove(course);
//The Professor gets the updated courseList
prof.setCoursesTaught(courseList);
//Checks if the course got removed
assertEquals(0,prof.getCoursesTaught().size() );
}
@Test
void registerUser() {
Administration administration = new Administration();

Loading…
Cancel
Save