Skip to content

Instantly share code, notes, and snippets.

@jbclements
Created April 18, 2012 03:53
Show Gist options
  • Save jbclements/2411004 to your computer and use it in GitHub Desktop.
Save jbclements/2411004 to your computer and use it in GitHub Desktop.
shuffled 15
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 test() {
RectangularPrism rec1 = new RectangularPrism(1,1,1,10,15,0);
RectangularPrism rec2 = new RectangularPrism(3,1,2,1,0,1);
RectangularPrism rec3 = new RectangularPrism(2,2,2,4,4,4);
SimpleWorld world1 = new TestingWorld(20,20,20);
assertEquals(new RectangularPrism(2,2,2,10,15,0),rec1.scale(2));
assertEquals(new RectangularPrism(1,1,1,11,17,3), rec1.translate(1,2,3));
assertEquals(Material.AIR, world1.getBlockType(1, 1, 1));
world1.setBlockType(1,1,1,Material.STONE);
assertEquals(Material.STONE, world1.getBlockType(1,1,1));
// Since the render method is a void method we cannot use assertEquals
// so I will call it on a rectangular prism and world1 and use getBlockType to show it worked.
rec3.render(world1, Material.DIAMOND);
assertEquals(Material.DIAMOND, world1.getBlockType(4,4,4));
assertEquals(true, new RectangularPrism(1,1,1,1,1,1).equals(new RectangularPrism(1,1,1,1,1,1)));
assertTrue(new RectangularPrism(1,1,1,1,1,1).hashCode() != 0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment