Commit c7fb6984 authored by Alexander's avatar Alexander
Browse files

Add ioc-code error test

parent 7761ad7e
...@@ -12,7 +12,7 @@ import org.junit.jupiter.api.Test; ...@@ -12,7 +12,7 @@ import org.junit.jupiter.api.Test;
*/ */
public class ErrorTests extends Assignment2TestBase { public class ErrorTests extends Assignment2TestBase {
/** /**
* This tests admin functionality * This tests several admin errors
*/ */
@Test @Test
@DisplayName("admin") @DisplayName("admin")
...@@ -28,4 +28,13 @@ public class ErrorTests extends Assignment2TestBase { ...@@ -28,4 +28,13 @@ public class ErrorTests extends Assignment2TestBase {
void competitionErrors() { void competitionErrors() {
testWithIOFile(getDataFolderDirectory() + "error_tests/add_competition.io"); testWithIOFile(getDataFolderDirectory() + "error_tests/add_competition.io");
} }
/**
* This tests several ioc-code errors
*/
@Test
@DisplayName("ioc-code")
void iocCodeErrors() {
testWithIOFile(getDataFolderDirectory() + "error_tests/ioc_code.io");
}
} }
Automatically created test
> add-admin sebastian;stüker;gbi_god;modus_ponens
OK
> login-admin gbi_god;modus_ponens
OK
> add-ioc-code
Error, wrong parameters
> add-ioc-code
Error, wrong parameters
> add-ioc-code ;;;
Error, wrong parameters
> add-ioc-code 0;ger;germany;1989
Error, wrong parameters
> add-ioc-code -1;ger;germany;1989
Error, wrong parameters
> add-ioc-code 0000;ger;germany;1989
Error, wrong parameters
> add-ioc-code 000;ger;germany;1989
Error, invalid id
> add-ioc-code 1000;ger;germany;1989
Error, wrong parameters
> add-ioc-code 001;gerr;germany;1989
Error, ioc-code has not length of 3
> add-ioc-code 001;ge;germany;1989
Error, ioc-code has not length of 3
> add-ioc-code 001;ger;germany;1989
OK
> add-ioc-code 002;ger;germany;1989
Error, ioc-code already exists
> add-ioc-code 001;usa;usa;1906
Error, id already exists
\ 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