mirror of
https://gitlab.com/arnekeller/kit-programmieren-ws1920-final2.git
synced 2024-11-24 09:24:57 +00:00
Add command tests
This commit is contained in:
parent
f240ecf5f0
commit
fffc21a73e
6
commands1_input.txt
Normal file
6
commands1_input.txt
Normal file
@ -0,0 +1,6 @@
|
||||
list-buildings
|
||||
list-resources
|
||||
list-buildings I can build
|
||||
list-resources I can buy
|
||||
reset
|
||||
reset the game
|
6
commands1_output.txt
Normal file
6
commands1_output.txt
Normal file
@ -0,0 +1,6 @@
|
||||
EMPTY
|
||||
EMPTY
|
||||
Error, invalid list-buildings argument: none expected
|
||||
Error, invalid list-resources argument: none expected
|
||||
OK
|
||||
Error, invalid reset argument: none expected
|
@ -13,6 +13,11 @@ class MainTest {
|
||||
cmpInOut("game1_input.txt", "game1_output.txt");
|
||||
}
|
||||
|
||||
@Test
|
||||
void commands1() throws IOException {
|
||||
cmpInOut("commands1_input.txt", "commands1_output.txt");
|
||||
}
|
||||
|
||||
private void cmpInOut(String in, String out) throws IOException {
|
||||
System.setIn(new ByteArrayInputStream(readFile(in)));
|
||||
ByteArrayOutputStream output = new ByteArrayOutputStream();
|
||||
|
Loading…
Reference in New Issue
Block a user