summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornitnelave <nitnelave1@gmail.com>2013-02-15 02:38:34 +0100
committerGJ <gjmcferrin@gmail.com>2013-03-20 18:44:22 -0400
commitddec7117eedaccd04202326bec23c3837b57f9eb (patch)
tree202c333f19dc5656ac30a89e86225f15dcb5e277
parent696543cf3f43756dfc2d4c1d18b2b461badcb107 (diff)
downloadcraftbukkit-ddec7117eedaccd04202326bec23c3837b57f9eb.tar
craftbukkit-ddec7117eedaccd04202326bec23c3837b57f9eb.tar.gz
craftbukkit-ddec7117eedaccd04202326bec23c3837b57f9eb.tar.lz
craftbukkit-ddec7117eedaccd04202326bec23c3837b57f9eb.tar.xz
craftbukkit-ddec7117eedaccd04202326bec23c3837b57f9eb.zip
Implement unit test for hasGravity(). Adds BUKKIT-3832
-rw-r--r--src/test/java/org/bukkit/PerMaterialTest.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/java/org/bukkit/PerMaterialTest.java b/src/test/java/org/bukkit/PerMaterialTest.java
index f55920bf..ab4333c3 100644
--- a/src/test/java/org/bukkit/PerMaterialTest.java
+++ b/src/test/java/org/bukkit/PerMaterialTest.java
@@ -10,6 +10,7 @@ import net.minecraft.server.BlockFire;
import net.minecraft.server.Item;
import net.minecraft.server.ItemFood;
import net.minecraft.server.ItemRecord;
+import net.minecraft.server.BlockSand;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.inventory.ItemStack;
@@ -127,4 +128,13 @@ public class PerMaterialTest extends AbstractTestingBase {
assertFalse(material.isOccluding());
}
}
+
+ @Test
+ public void hasGravity() {
+ if (material.isBlock()) {
+ assertThat(material.hasGravity(), is(Block.byId[material.getId()] instanceof BlockSand));
+ } else {
+ assertFalse(material.hasGravity());
+ }
+ }
}