Commit 4f039d04 authored by Alexander's avatar Alexander

Add athlete error test

parent 7c520b44
......@@ -54,4 +54,12 @@ public class ErrorTests extends Assignment2TestBase {
void olympicSportsErrors() {
testWithIOFile(getDataFolderDirectory() + "error_tests/olympic_sport.io");
}
/**
* This tests several athlete errors
*/
@Test
@DisplayName("athlete")
void athleteErrors() {
testWithIOFile(getDataFolderDirectory() + "error_tests/athlete.io");
}
}
Automatically created test
> add-admin sebastian;stüker;gbi_god;modus_ponens
OK
> login-admin gbi_god;modus_ponens
OK
> add-athlete
Error, wrong parameters
> add-athlete
Error, wrong parameters
> add-athlete ;;;;;
Error, wrong parameters
> add-ioc-code 001;usa;united states of america;1989
OK
> add-athlete 0001;sebastian;stüker;united states of america;workout;audimax morning workout
Error, sport is unknown
> add-olympic-sport workout;audimax morning workout
OK
> add-athlete 0001;sebastian;stüker;germany;workout;audimax morning workout
Error, country is unknown
> add-ioc-code 002;ger;germany;1989
OK
> add-athlete 0;sebastian;stüker;germany;workout;audimax morning workout
Error, wrong parameters
> add-athlete 0000;sebastian;stüker;germany;workout;audimax morning workout
Error, invalid id
> add-athlete 0001;sebastian;stüker;germany;workout;audimax morning workout
OK
> add-athlete 0001;sebastian;stüker;germany;workout;audimax morning workout
Error, athlete already exists
> add-athlete 0001;sebastian;stüker;united states of america;workout;audimax morning workout
Error, athlete already exists
> add-olympic-sport drehtüren;bibliotheks drehtüren
OK
> add-athlete 0001;sebastian;stüker;united states of america;workout;audimax morning workout
Error, athlete already exists
> add-athlete 0001;sebastian;stüker;united states of america;drehtüren;bibliotheks drehtüren
Error, athlete originates from germany
> add-athlete 0001;sebastian;stüker;germany;drehtüren;bibliotheks drehtüren
OK
> add-athlete 0001;frank;herrlich;germany;workout;audimax morning workout
Error, id is assigned to sebastian stüker
> add-athlete 0002;frank;herrlich;germany;workout;audimax morning workout
OK
> summary-athletes
Error, wrong parameters
> summary-athletes
Error, wrong parameters
> summary-athletes ;
Error, wrong parameters
> summary-athletes drehtüren;mathebau drehtüren
Error, invalid sport
> summary-athletes drehtüren;bibliotheks drehtüren
0001 sebastian stüker 0
> summary-athletes workout;audimax morning workout
0001 sebastian stüker 0
0002 frank herrlich 0
> add-competition 0001;2018;germany;workout;audimax morning workout;1;0;0
OK
> summary-athletes workout;audimax morning workout
0001 sebastian stüker 1
0002 frank herrlich 0
\ No newline at end of file
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