Created
April 18, 2012 03:49
-
-
Save jbclements/2410993 to your computer and use it in GitHub Desktop.
shuffled 13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.calpoly.cpe102sp12; | |
import static org.junit.Assert.*; | |
import org.bukkit.Material; | |
import org.junit.Test; | |
public class Testing { | |
RectangularPrism prism1 = new RectangularPrism(2, 2, 2, 2, 2, 2); | |
RectangularPrism prism2 = new RectangularPrism(5, 2, 4, 5, 2, 4); | |
RectangularPrism prism3 = new RectangularPrism(6, 6, 6, 2, 2, 2); | |
@Test | |
public void test() { | |
assertEquals(prism3, prism1.scale(3)); | |
assertEquals(prism3, prism1.scale(3.25)); | |
assertEquals(prism2, prism1.translate(3, 0, 2)); | |
TestingWorld world1 = new TestingWorld(20, 21, 22); | |
assertEquals(Material.AIR, world1.getBlockType(0, 0, 0)); | |
assertEquals(Material.AIR, world1.getBlockType(19, 20, 21)); | |
world1.setBlockType(10, 10, 10, Material.DIRT); | |
assertEquals(Material.DIRT, world1.getBlockType(10, 10, 10)); | |
SimpleWorld world2 = new TestingWorld(20, 21, 22); | |
RectangularPrism rp1 = new RectangularPrism(10,10,10,5,6,7); | |
world2 = rp1.render(world2, Material.STONE); | |
assertEquals(Material.STONE, world2.getBlockType(9, 9, 9)); | |
TestingWorld world3 = new TestingWorld(100, 100, 100); | |
RectangularPrism rp2 = new RectangularPrism(12,15,21,50,50,50); | |
world3 = (TestingWorld) rp2.render(world3, Material.STONE); | |
assertEquals(Material.STONE, world3.getBlockType(52, 52, 52)); | |
assertEquals(Material.STONE, world3.getBlockType(55,56,59)); | |
assertEquals(Material.AIR, world3.getBlockType(63,65,70)); | |
assertEquals(Material.AIR, world3.getBlockType(43,57,52)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment