Skip to content

Instantly share code, notes, and snippets.

@jbclements
Created April 18, 2012 03:24
Show Gist options
  • Save jbclements/2410904 to your computer and use it in GitHub Desktop.
Save jbclements/2410904 to your computer and use it in GitHub Desktop.
shuffled 06
package edu.calpoly.cpe102sp12;
import org.bukkit.Material;
import static org.junit.Assert.*;
import org.junit.Test;
public class Testing {
@Test
public void test() {
RectangularPrism r1 = new RectangularPrism(5, 8, 9, 0, 0, 0);
RectangularPrism r2 = new RectangularPrism(10, 3, 19, 1, 1, 0);
RectangularPrism r3 = new RectangularPrism(2, 2, 2, 1, 1, 1);
RectangularPrism r4 = new RectangularPrism(5, 5, 5, 4, 4, 4);
assertEquals(new RectangularPrism(8, 12, 14, 0, 0, 0), r1.scale(1.5));
assertEquals(new RectangularPrism(10, 3, 19, 3, 7, 3), r2.translate(2, 6, 3));
assertEquals(true, r1.equals(r1));
TestingWorld world = new TestingWorld(5, 5, 5);
TestingWorld world2 = new TestingWorld(12, 12, 12);
world.setBlockType(2, 3, 4, Material.STONE);
assertEquals(Material.AIR, world.getBlockType(4, 4, 4));
assertEquals(Material.STONE, world.getBlockType(2, 3, 4));
r3.render(world, Material.DIRT);
assertEquals(Material.DIRT, world.getBlockType(1, 1, 1));
r4.render(world2, Material.BRICK);
assertEquals(Material.BRICK, world2.getBlockType(5, 5, 5));
assertEquals(Material.AIR, world2.getBlockType(5, 6, 5));
assertEquals(Material.BRICK, world2.getBlockType(1, 1, 1));
assertEquals(Material.BRICK, world2.getBlockType(1, 5, 1));
assertEquals(Material.AIR, world2.getBlockType(1, 6, 1));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment