package org.sudoku.generator.board;

import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;

public class SquareTests {
	
	@Before
	public void init(){
	}

	@Test
	public void squareNotValid(){
		Square square = new Square();
		square.addCell(0, 0, new Cell(4));
		square.addCell(0, 1, new Cell(4));
		
		assertFalse(square.squareValid());
	}
	
	@Test
	public void generateValidSquare(){
		assertTrue(Square.generateValidSquare().squareValid());
		assertTrue(Square.generateValidSquare().squareValid());
		assertTrue(Square.generateValidSquare().squareValid());
	}
	
}

@@ -147,36 +147,450 @@
 %0A%09%0A%09
-@Before%0A%09public void init()%7B
+Square validSquare = new Square();%0A%09@Before%0A%09public void init()%7B%0A%09%09validSquare.addCell(0, 0, new Cell(5));%0A%09%09validSquare.addCell(0, 1, new Cell(4));%0A%09%09validSquare.addCell(0, 2, new Cell(8));%0A%09%09validSquare.addCell(1, 0, new Cell(2));%0A%09%09validSquare.addCell(1, 1, new Cell(3));%0A%09%09validSquare.addCell(1, 2, new Cell(9));%0A%09%09validSquare.addCell(2, 0, new Cell(1));%0A%09%09validSquare.addCell(2, 1, new Cell(7));%0A%09%09validSquare.addCell(2, 2, new Cell(6));
 %0A%09%7D%0A
@@ -778,32 +778,113 @@
 ));%0A%09%7D%0A%09%0A%09@Test%0A
+%09public void squareValid()%7B%0A%09%09assertTrue(validSquare.squareValid());%0A%09%7D%0A%09%0A%09@Test%0A
 %09public void gen

add new test