Package crazyOrb.mechanics.test

Source Code of crazyOrb.mechanics.test.BlockFactoryTest

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);
      }
    }
  }

}
TOP

Related Classes of crazyOrb.mechanics.test.BlockFactoryTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.