Next, we should let the player know the status of the game.
As we are throwing exceptions when an error occurs, this is already covered, so we only need to implement these two tests. Furthermore, for the sake of testability, we need to introduce a parameter within the constructor. By introducing this parameter, the output becomes easier to test:
private OutputStream output; @Before public void beforeEachTest() { output = new ByteArrayOutputStream(); tested = new Connect4TDD(new PrintStream(output)); } @Test public void whenAskedForCurrentPlayerTheOutputNotice() { tested.getCurrentPlayer(); ...