quoridor/src/test/java/cz/xelfi/quoridor/BoardCase.java
changeset 107 152aedcc45d0
parent 92 de3dd5710a5c
child 178 4b78d4f028b3
     1.1 --- a/quoridor/src/test/java/cz/xelfi/quoridor/BoardCase.java	Fri Sep 18 07:16:47 2009 +0200
     1.2 +++ b/quoridor/src/test/java/cz/xelfi/quoridor/BoardCase.java	Tue Sep 22 23:06:16 2009 +0200
     1.3 @@ -144,6 +144,16 @@
     1.4              assertEquals("Column", 'H', f.getColumn());
     1.5          }
     1.6      }
     1.7 +    public void testTwoFencesInTheSamePosition() throws IllegalPositionException {
     1.8 +        assertEquals ("No on board", 0, board.getFences ().size ());
     1.9 +        Board one = board.apply(Move.fence('A', 1, Orientation.HORIZONTAL));
    1.10 +        try {
    1.11 +            Board snd = one.apply(Move.fence('A', 1, Orientation.HORIZONTAL));
    1.12 +            fail("Cannot place fence twice to the same place");
    1.13 +        } catch (IllegalPositionException ex) {
    1.14 +            // OK
    1.15 +        }
    1.16 +    }
    1.17      
    1.18      public void testSelfDestructionForbidden() throws Exception {
    1.19          Board b = board;