Skip to content

Commit

Permalink
Merge pull request #36 from sandorw/feature/tests
Browse files Browse the repository at this point in the history
HumanPlayer tests should use PlayerFactory
  • Loading branch information
sandorw committed Oct 19, 2015
2 parents adc38e8 + d533928 commit aca1cee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @author sandorw
*/
public final class HumanPlayerTest {
private HumanPlayer<DefaultGameMove> player;
private Player<DefaultGameMove> player;
private SimpleTestGameState gameState;

@Before
Expand All @@ -30,7 +30,7 @@ public void before() {
public void chooseNextMoveValidMoveTest() {
InputStream inputStream = new ByteArrayInputStream("1".getBytes(Charset.forName("UTF-8")));
System.setIn(inputStream);
player = new HumanPlayer<>();
player = PlayerFactory.getNewHumanPlayer();
DefaultGameMove move = player.chooseNextMove(gameState);
assertEquals(move.getLocation(), 1);
System.setIn(System.in);
Expand All @@ -40,7 +40,7 @@ public void chooseNextMoveValidMoveTest() {
public void chooseNextMoveInvalidMoveTest() {
InputStream inputStream = new ByteArrayInputStream("4 4 1".getBytes(Charset.forName("UTF-8")));
System.setIn(inputStream);
player = new HumanPlayer<>();
player = PlayerFactory.getNewHumanPlayer();
DefaultGameMove move = player.chooseNextMove(gameState);
assertEquals(move.getLocation(), 1);
System.setIn(System.in);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
import com.github.sandorw.mocabogaso.games.test.SimpleTestGameState;

/**
* Test cases for AIPlayerFactory
* Test cases for PlayerFactory
*
* @author sandorw
*/
public final class AIPlayerFactoryTest {
public final class PlayerFactoryTest {
SimpleTestGameState gameState;
Game<DefaultGameMove, SimpleTestGameState> game;

Expand Down

0 comments on commit aca1cee

Please sign in to comment.