aboutsummaryrefslogtreecommitdiff
path: root/src/portfolio1/MainTest.java
blob: 2901ef938d5718e4816c6f07584ba55527a83199 (plain)
  1. import org.junit.jupiter.api.Test;
  2. import static org.junit.jupiter.api.Assertions.assertEquals;
  3. public class MainTest {
  4. @Test
  5. void testValid() {
  6. Programme testProg = new Programme();
  7. for (int i = 0; i < 18; i++) {
  8. testProg.add(new Course(5, "course " + i));
  9. }
  10. for (int j = 0; j < 6; j++) {
  11. testProg.add(new Project(15, "project " + j));
  12. }
  13. assertEquals(false, testProg.isValid());
  14. }
  15. @Test
  16. void testCorrectProgramme() {
  17. Programme testProg = new Programme();
  18. for (int i = 0; i < 8; i++) {
  19. testProg.add(new BasicCourse(5, "Basic Course " + i));
  20. }
  21. for (int j = 0; j < 3; j++) {
  22. testProg.add(new BasicProject(15, "Basic Project " + j));
  23. }
  24. for (int i = 0; i < 8; i++) {
  25. testProg.add(new SubjectModuleCourse(5, "Subject Module Course " + i));
  26. }
  27. for (int i = 0; i < 2; i++) {
  28. testProg.add(new SubjectModuleProject(15, "Subject Module Project " + i));
  29. }
  30. for (int i = 0; i < 2; i++) {
  31. testProg.add(new ElectiveCourse(5, "Elective Course " + i));
  32. }
  33. testProg.add(new BachelorProject(15, "Bachelor Project"));
  34. assertEquals(true, testProg.isValid());
  35. }
  36. }