blob: 2901ef938d5718e4816c6f07584ba55527a83199 (
plain)
- 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());
- }
- }
|