Created
April 18, 2012 03:22
-
-
Save jbclements/2410889 to your computer and use it in GitHub Desktop.
shuffled 04
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 { | |
@Test | |
public void testing() { | |
RectangularPrism r1 = new RectangularPrism(2, 4, 4, 1, 2, 2); | |
RectangularPrism r2 = new RectangularPrism(5, 3, 11, 2, 1, 5); | |
RectangularPrism r3 = new RectangularPrism(1, 2, 3, 20, 30, 40); | |
TestingWorld t1 = new TestingWorld(50, 50, 50); | |
assertEquals(new RectangularPrism(8, 16, 16, 1, 2, 2), r1.scale(4)); | |
assertEquals(new RectangularPrism(5, 3, 11, 6, 11, 4), r2.translate(4, 10, -1)); | |
assertEquals(Material.AIR, t1.getBlockType(30, 30, 10)); | |
t1.setBlockType(25, 20, 15, Material.FERMENTED_SPIDER_EYE); | |
assertEquals(Material.FERMENTED_SPIDER_EYE, t1.getBlockType(25, 20, 15)); | |
RectangularPrism rp1 = new RectangularPrism(5,5,5,8,8,8); | |
rp1.render(t1, Material.STONE); | |
assertEquals(Material.STONE, t1.getBlockType(5, 7, 7)); | |
assertEquals(Material.STONE, t1.getBlockType(9, 7, 7)); | |
assertEquals(Material.STONE, t1.getBlockType(5, 5, 5)); | |
assertEquals(Material.STONE, t1.getBlockType(9, 5, 9)); | |
assertEquals(Material.AIR, t1.getBlockType(4, 5, 5)); | |
assertEquals(Material.AIR, t1.getBlockType(10, 9, 9)); | |
r3.render(t1, Material.TNT); | |
assertEquals(Material.TNT, t1.getBlockType(19, 29, 39)); | |
assertEquals(Material.TNT, t1.getBlockType(19, 30, 38)); | |
assertEquals(Material.TNT, t1.getBlockType(19, 29, 40)); | |
assertEquals(Material.TNT, t1.getBlockType(19, 30, 40)); | |
assertEquals(Material.AIR, t1.getBlockType(18, 30, 39)); | |
assertEquals(Material.AIR, t1.getBlockType(20, 30, 38)); | |
assertEquals(Material.AIR, t1.getBlockType(19, 28, 40)); | |
assertEquals(Material.AIR, t1.getBlockType(19, 31, 40)); | |
assertEquals(Material.AIR, t1.getBlockType(19, 30, 41)); | |
assertEquals(Material.AIR, t1.getBlockType(19, 30, 37)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment