Exemplo n.º 1
0
  @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());
  }
Exemplo n.º 2
0
  @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());
  }