package ruby.ninja.experiments.zahlenpuzzle.board;

import org.junit.Before;
import org.junit.Test;
import rubys.ninja.experiments.zahlenpuzzle.board.BoardSize;

import static org.junit.Assert.assertSame;

public class BoardSizeTest {
    private BoardSize size;

    @Before
    public void setup() throws Exception {
        size = new BoardSize(4, 52);
    }

    @Test
    public void testWidth() {
        assertSame(4, size.getWidth());
    }

    @Test
    public void testHeight() {
        assertSame(52, size.getHeight());
    }

    @Test
    public void testZeroWidth() throws Exception {
        BoardSize zeroBoardSize = new BoardSize(0, 0);
        assertSame(0, zeroBoardSize.getWidth());
    }

    @Test
    public void testZeroHeight() throws Exception {
        BoardSize zeroBoardSize = new BoardSize(0, 0);
        assertSame(0, zeroBoardSize.getHeight());
    }

    @Test(expected = Exception.class)
    public void testNegativeWidth() throws Exception {
        BoardSize negativeBoardSize = new BoardSize(-3, 3);
    }

    @Test(expected = Exception.class)
    public void testNegativeHeight() throws Exception {
        BoardSize negativeBoardSize = new BoardSize(0, -3);
    }
}

@@ -186,26 +186,17 @@
 .Assert.
-assertSame
+*
 ;%0A%0Apubli
@@ -1189,11 +1189,247 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testEquals() throws Exception %7B%0A        BoardSize boardSize = new BoardSize(1, 2);%0A%0A        assertTrue(boardSize.equals(new BoardSize(1, 2)));%0A        assertFalse(boardSize.equals(new BoardSize(2, 1)));%0A    %7D
 %0A%7D%0A

Add test for BoardSize.equals