From 94f7348c379f16036e67dce1ad94be274fc84ec8 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 1 May 2025 02:15:59 +0200 Subject: add/update build and zip generation routines --- src/portfolio1/MainTest.java | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/portfolio1/MainTest.java (limited to 'src/portfolio1/MainTest.java') diff --git a/src/portfolio1/MainTest.java b/src/portfolio1/MainTest.java new file mode 100644 index 0000000..2901ef9 --- /dev/null +++ b/src/portfolio1/MainTest.java @@ -0,0 +1,42 @@ +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class MainTest { + + @Test + void testValid() { + Programme testProg = new Programme(); + for (int i = 0; i < 18; i++) { + testProg.add(new Course(5, "course " + i)); + } + for (int j = 0; j < 6; j++) { + testProg.add(new Project(15, "project " + j)); + } + assertEquals(false, testProg.isValid()); + } + + @Test + void testCorrectProgramme() { + Programme testProg = new Programme(); + for (int i = 0; i < 8; i++) { + testProg.add(new BasicCourse(5, "Basic Course " + i)); + } + for (int j = 0; j < 3; j++) { + testProg.add(new BasicProject(15, "Basic Project " + j)); + } + for (int i = 0; i < 8; i++) { + testProg.add(new SubjectModuleCourse(5, "Subject Module Course " + i)); + } + for (int i = 0; i < 2; i++) { + testProg.add(new SubjectModuleProject(15, "Subject Module Project " + i)); + } + for (int i = 0; i < 2; i++) { + testProg.add(new ElectiveCourse(5, "Elective Course " + i)); + } + testProg.add(new BachelorProject(15, "Bachelor Project")); + assertEquals(true, testProg.isValid()); + } + +} + -- cgit v1.2.3