Browse Source

4gewinnt: refactored playChip testmethods

4gewinnt
Steffen Helmke 3 years ago
committed by Lorenz Hohmann
parent
commit
09ed2fe825
  1. 2
      src/main/java/de/tims/viergewinnt/ai/Logic.java
  2. 3
      src/test/java/de/tims/viergewinnt/ai/LogicTest.java

2
src/main/java/de/tims/viergewinnt/ai/Logic.java

@ -20,7 +20,7 @@ public class Logic {
//add board update
//updateGui(playfield);
updateGui(playfield);
testForWin(playfield, player);
currentPlayer = (player % 2) + 1;
return 0;

3
src/test/java/de/tims/viergewinnt/ai/LogicTest.java

@ -34,6 +34,7 @@ class LogicTest {
int column = 0;
int player = 1;
int expectedResult = 0;
testObj.create4gewinntGui();
int realResult = testObj.playChip(playfield, column, player);
assertEquals(expectedResult, realResult);
@ -46,6 +47,7 @@ class LogicTest {
int player = 1;
int expectedResult = 2;
testObj.create4gewinntGui();
testObj.playChip(playfield, column, player);
int realResult = testObj.currentPlayer;
@ -59,6 +61,7 @@ class LogicTest {
int player = 2;
int expectedResult = 1;
testObj.create4gewinntGui();
testObj.playChip(playfield, column, player);
int realResult = testObj.currentPlayer;

Loading…
Cancel
Save