Skip to content
This repository has been archived by the owner on Nov 29, 2017. It is now read-only.

Commit

Permalink
Added some missing test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
vapour101 committed Aug 31, 2017
1 parent ca0f7f1 commit 82ffad7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/test/java/logic/BoardTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public void equals() {
board2.playStone(getCoords("M17"), StoneColour.WHITE);

assertThat(board1, is(board2));

assertThat(board1, is(board1));
assertThat(board1, is(not(getCoords("D4"))));
}

@Test
Expand Down
12 changes: 12 additions & 0 deletions src/test/java/logic/LocalGameHandlerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.junit.Test;
import util.StoneColour;

import static org.hamcrest.CoreMatchers.hasItems;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static util.Coords.getCoords;
Expand All @@ -28,6 +29,17 @@ public class LocalGameHandlerTest {

private static final String[] koBoard = {"C4", "D4", "D3", "E3", "D5", "E5", "K4", "F4", "E4"};

@Test
public void gameTracking() {
LocalGameHandler handler = new LocalGameHandler();

handler.playStone(getCoords("D4"), StoneColour.BLACK);
handler.playStone(getCoords("E5"), StoneColour.WHITE);

assertThat(handler.getStones(StoneColour.BLACK), hasItems(getCoords("D4")));
assertThat(handler.getStones(StoneColour.WHITE), hasItems(getCoords("E5")));
}

@Test
public void koIsIllegal() {
LocalGameHandler handler = buildTestHandler(koBoard);
Expand Down

0 comments on commit 82ffad7

Please sign in to comment.