package crazyOrb.mechanics.test;
import static org.junit.Assert.assertTrue;
import java.util.LinkedList;
import org.junit.BeforeClass;
import org.junit.Test;
import crazyOrb.mechanics.BlockFactory;
import crazyOrb.mechanics.DropableFigure;
import crazyOrb.mechanics.MovableFigure;
import crazyOrb.mechanics.Playground;
public class BlockFactoryTest {
private static Playground spielFeld;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
spielFeld = new Playground(null);
}
@Test
public void testGetNewBlocks() {
for(int i = 0; i < 10; i++){
LinkedList<DropableFigure> newBlocks = BlockFactory.getNewBlocks(spielFeld);
for(MovableFigure block : newBlocks){
assertTrue("Die X-Koordinate muss auf dem Feld sein!", block.getxPos() < spielFeld.getWidth());
assertTrue("Die Y-Koordinate muss 0 sein!", block.getyPos() == 0);
}
}
}
}