From 326fd032bb85c8f0963af4353240e29862b982f1 Mon Sep 17 00:00:00 2001 From: Tobias Herbert Date: Tue, 6 Feb 2024 22:13:54 +0100 Subject: [PATCH] Add AdministrationTest Class and added test for findProfessorByID Method --- .../java/org/example/AdministrationTest.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/test/java/org/example/AdministrationTest.java diff --git a/src/test/java/org/example/AdministrationTest.java b/src/test/java/org/example/AdministrationTest.java new file mode 100644 index 0000000..3b78a4a --- /dev/null +++ b/src/test/java/org/example/AdministrationTest.java @@ -0,0 +1,22 @@ +package org.example; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +class AdministrationTest { + + @Test + void findProfessorById() { + Administration administration = new Administration(); + Professor prof1 = new Professor("P1001", "Aaron", "Professor"); + + administration.addProfessor(prof1); + + Professor foundProf1 = administration.findProfessorById("P1001"); + assertEquals(prof1, foundProf1); + + + + } +} \ No newline at end of file