|
|
@ -27,8 +27,9 @@ class LogicTest { |
|
|
|
testObj.setField(playfield[i][j], i, j); |
|
|
|
} |
|
|
|
} |
|
|
|
testObj.setCurrentPlayer(player); |
|
|
|
|
|
|
|
boolean realResult = testObj.testForWin(player); |
|
|
|
boolean realResult = testObj.testForWin(); |
|
|
|
|
|
|
|
assertEquals(expectedResult, realResult); |
|
|
|
} |
|
|
@ -39,7 +40,9 @@ class LogicTest { |
|
|
|
int player = 1; |
|
|
|
int expectedResult = 0; |
|
|
|
testObj.create4gewinntGui(); |
|
|
|
int realResult = testObj.playChip(column, player); |
|
|
|
testObj.setCurrentPlayer(player); |
|
|
|
|
|
|
|
int realResult = testObj.playChip(column); |
|
|
|
|
|
|
|
assertEquals(expectedResult, realResult); |
|
|
|
} |
|
|
@ -49,9 +52,10 @@ class LogicTest { |
|
|
|
int column = 0; |
|
|
|
int player = 1; |
|
|
|
int expectedResult = 2; |
|
|
|
|
|
|
|
testObj.create4gewinntGui(); |
|
|
|
testObj.playChip(column, player); |
|
|
|
testObj.setCurrentPlayer(player); |
|
|
|
testObj.playChip(column); |
|
|
|
|
|
|
|
int realResult = testObj.currentPlayer; |
|
|
|
|
|
|
|
assertEquals(expectedResult, realResult); |
|
|
@ -62,9 +66,10 @@ class LogicTest { |
|
|
|
int column = 0; |
|
|
|
int player = 2; |
|
|
|
int expectedResult = 1; |
|
|
|
|
|
|
|
testObj.create4gewinntGui(); |
|
|
|
testObj.playChip(column, player); |
|
|
|
testObj.setCurrentPlayer(player); |
|
|
|
testObj.playChip(column); |
|
|
|
|
|
|
|
int realResult = testObj.currentPlayer; |
|
|
|
|
|
|
|
assertEquals(expectedResult, realResult); |
|
|
|