@@ -0,0 +1,1504 @@
+package org.foobar.minesweeper.model;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport java.util.Random;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.mockito.MockitoAnnotations;%0A%0Apublic class ModelTest %7B%0A  @SuppressWarnings(%22serial%22)%0A  private final Random random = new Random() %7B%0A    @Override protected int next(int bits) %7B%0A      return 1;%0A    %7D%0A  %7D;%0A%0A  private Minefield field;%0A%0A  @Before%0A  public void setUp() throws Exception %7B%0A    MockitoAnnotations.initMocks(this);%0A    field = new Minefield(10, 10, 10, random);%0A  %7D%0A%0A  @Test(expected=IllegalArgumentException.class)%0A  public void constructor() %7B%0A    field = new Minefield(-1, 0, 0);%0A  %7D%0A%0A  @Test%0A  public void numberOfMines() %7B%0A    assertEquals(field.getMines(), 10);%0A%0A    field.getSquare(0, 0).reveal();%0A%0A    int mines = 0;%0A%0A    for(int i=0; i%3Cfield.getRowCount(); i++) %7B%0A      for(int j=0; j%3Cfield.getColumnCount(); j++) %7B%0A        if (field.getSquare(i, j).isMine())%0A          mines++;%0A      %7D%0A    %7D%0A%0A    assertEquals(mines, field.getMines());%0A  %7D%0A%0A  @Test(expected=IndexOutOfBoundsException.class)%0A  public void getNegativeRow() %7B%0A    field.getSquare(-1, 0);%0A  %7D%0A%0A  @Test(expected=IndexOutOfBoundsException.class)%0A  public void getNegativeColumn() %7B%0A    field.getSquare(0, -1);%0A  %7D%0A  @Test(expected=IndexOutOfBoundsException.class)%0A  public void getOutOfBoundsRow() %7B%0A    field.getSquare(10, 0);%0A  %7D%0A  @Test(expected=IndexOutOfBoundsException.class)%0A  public void getOutOfBoundsColumn() %7B%0A    field.getSquare(0, 10);%0A  %7D%0A%7D%0A

add test from master branch