@Test public void getThePlayersSymbol() { PromptSpy prompt = new PromptSpy(new StringReader("")); HumanPlayer player = new HumanPlayer(X, prompt); assertThat(player.getSymbol(), is(X)); }
@Test public void humanPlayerIsReady() { PromptSpy prompt = new PromptSpy(new StringReader("1\n")); HumanPlayer player = new HumanPlayer(X, prompt); Board board = new Board(X, VACANT, X, O, X, O, X, O, VACANT); assertThat(player.isReady(), is(true)); }
@Test public void playerProvidesPromptWithNextMove() throws IOException { PromptSpy prompt = new PromptSpy(new StringReader("1\n")); HumanPlayer player = new HumanPlayer(X, prompt); Board board = new Board(X, VACANT, X, O, X, O, X, O, VACANT); assertThat(player.chooseNextMoveFrom(board), is(1)); }