Commit 40cdb521 authored by Jon Amos Fehling's avatar Jon Amos Fehling
Browse files

add test competition

parent 9868d441
......@@ -14,10 +14,10 @@ public class CaseCreator {
private final Random random = new Random();
private long rgenseed = System.currentTimeMillis();
private final int nCountries = 20;
private final int nSports = 20;
private final int nAthletes = 21;
private final int nErrors = 100;
private final int nCountries = 10;
private final int nSports = 2;
private final int nAthletes = 10;
private final int nErrors = 2;
public static void main(String args[]) {
......@@ -57,7 +57,7 @@ public class CaseCreator {
ids.add(id);
pairs.add(new TestPair("add-ioc-code " + id + ";" + countries.elementAt(2 * i + 1) + ";"
+ countries.elementAt(2 * i) + ";2000", "OK"));
+ countries.elementAt(2 * i) + ";1946", "OK"));
}
ids.clear();
......@@ -130,7 +130,7 @@ public class CaseCreator {
for (int s = 0; s < nSports; s++) {
pairs.add(new TestPair("summary-athletes " + sports.elementAt(s), ""));
pairs.add(new TestPair("summary-athletes " + sports.elementAt(s) + ";" + sports.elementAt(s), ""));
}
pairs.add(new TestPair("olympic-medal-table", ""));
......
......@@ -55,4 +55,10 @@ class IOTestsWithError extends Assignment2TestBase {
void competitionTests2() {
testWithIOFile(getDataFolderDirectory() + "competition_tests_2.io");
}
@Test
@DisplayName("competition-tests-3")
void competitionTests3() {
testWithIOFile(getDataFolderDirectory() + "competition_tests_3.io");
}
}
This diff is collapsed.
......@@ -5,9 +5,11 @@ OK
OK
> add-olympic-sport eishockey;eishockey
OK
> add-ioc-code 111;arg;argentinien;1920
> add-ioc-code 111;arg;argentinien;1940
OK
> add-athlete 0001;max;mustermann;argentinien;eishockey;eishockey
OK
> add-competition 0001;2002;canada;eishockey;eishockey;-1;0;0
Error, wrong number of medals
\ No newline at end of file
Error, wrong number of medals
> add-competition 0001;1926;canada;eishockey;eishockey;1;0;0
Error, year 1926 is before year of registration.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment