Browse Source

refactoring: extracting sampleStudents in AdministrationTest file

remotes/origin/fdai7780
fdai7921 11 months ago
parent
commit
f4db111d22
  1. 8
      src/test/java/org/example/AdministrationTest.java

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

@ -8,6 +8,8 @@ class AdministrationTest {
Administration admin = new Administration();
private static final Course sampleCourse = new Course("Math", "M101", 4);
private static final Student sampleStudent = new Student("Walter White", "S123456", "Student");
private static final Student sampleStudent2 = new Student("Jesse Pinkman", "S789012", "Student");
// Test the findProfessorById Method
@Test
@ -112,7 +114,7 @@ class AdministrationTest {
@Test
void addStudents() {
// Creating a sample student
Student student = new Student("Walter White", "S123456", "Student");
Student student = sampleStudent;
// Adding the student to the system
admin.addStudents(student);
@ -139,8 +141,8 @@ class AdministrationTest {
*/
@Test
void deleteStudents() {
Student student1 = new Student("Walter White", "S123456", "Student");
Student student2 = new Student("Jesse Pinkmann", "S789012", "Student");
Student student1 = sampleStudent;
Student student2 = sampleStudent2;
// Add students to the administration
admin.addStudents(student1);

Loading…
Cancel
Save