@Test public void OnGameOverItWritesTheGameOver() { FakeWriter writer = new FakeWriter(); ConsoleDisplay display = new ConsoleDisplay(writer); display.GameOver(); List<String> expectedLines = new ArrayList<String>(); expectedLines.add("com.hangman.Game Over"); assertEquals(expectedLines, writer.writtenLines()); }
@Test public void OnUpdateOfGameItDisplaysCurrentClue() { FakeWriter writer = new FakeWriter(); ConsoleDisplay display = new ConsoleDisplay(writer); currentClue = Arrays.asList('_', 'a', '_'); display.update(this, writer); List<String> expectedLines = new ArrayList<String>(); expectedLines.add("Current Clue Is _ a _ "); assertEquals(expectedLines, writer.writtenLines()); }