Created
April 18, 2012 03:29
-
-
Save jbclements/2410918 to your computer and use it in GitHub Desktop.
shuffled 12
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 java.util.Arrays; | |
import org.bukkit.Material; | |
import org.junit.Test; | |
public class Testing { | |
@Test | |
public void testPrism() { | |
RectangularPrism pris1 = new RectangularPrism(10, 10, 10, 0, 0, 0); | |
RectangularPrism pris2 = new RectangularPrism(5, 5, 5, 10, 10, 10); | |
RectangularPrism pris3 = new RectangularPrism(5, 5, 5, 20, 20, 20); | |
RectangularPrism pris4 = new RectangularPrism(13, 13, 13, 0, 0, 0); | |
assertEquals(pris4.xLoc, pris1.scale(2.0).xLoc); | |
assertEquals(pris4.xDim, pris1.scale(2.0).xDim); | |
assertEquals(pris4.yLoc, pris1.scale(2.0).yLoc); | |
assertEquals(pris4.yDim, pris1.scale(2.0).yDim); | |
assertEquals(pris4.zLoc, pris1.scale(2.0).zLoc); | |
assertEquals(pris4.zDim, pris1.scale(2.0).zDim); | |
assertEquals(pris3.xLoc, pris2.translate(10, 10, 10).xLoc); | |
assertEquals(pris3.yLoc, pris2.translate(10, 10, 10).yLoc); | |
assertEquals(pris3.zLoc, pris2.translate(10, 10, 10).zLoc); | |
assertEquals(pris3.xDim, pris2.translate(10, 10, 10).xDim); | |
assertEquals(pris3.yDim, pris2.translate(10, 10, 10).yDim); | |
assertEquals(pris3.zDim, pris2.translate(10, 10, 10).zDim); | |
} | |
@Test | |
public void testWorld() { | |
SimpleWorld testW1 = new TestingWorld(10, 10, 10); | |
SimpleWorld testW2 = new TestingWorld(11, 11, 11); | |
SimpleWorld testW3 = new TestingWorld(90, 90, 90); | |
assertEquals(Material.AIR, testW1.getBlockType(3, 3, 3)); | |
testW3.setBlockType(3, 3, 3, Material.STONE); | |
assertEquals(Material.STONE, testW3.getBlockType(3, 3, 3)); | |
RectangularPrism pris1 = new RectangularPrism(10, 10, 10, 11, 11, 11); | |
pris1.render(testW2, Material.STONE); | |
assertEquals(Material.STONE, testW2.getBlockType(7, 7, 7)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment