summaryrefslogtreecommitdiffstats
path: root/src/test/java/org/bukkit/PerMaterialTest.java
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-01-16 09:57:47 +1100
committermd_5 <git@md-5.net>2018-01-16 09:57:47 +1100
commitbdcc7c7b02947498f0c9b5adfd4a66bc1600d2cf (patch)
tree45734f5474cdf0a4822f96bdce73ac632022927a /src/test/java/org/bukkit/PerMaterialTest.java
parentbd308430b5e8fe0499e2c45d6f38f224f6e4e2da (diff)
downloadcraftbukkit-bdcc7c7b02947498f0c9b5adfd4a66bc1600d2cf.tar
craftbukkit-bdcc7c7b02947498f0c9b5adfd4a66bc1600d2cf.tar.gz
craftbukkit-bdcc7c7b02947498f0c9b5adfd4a66bc1600d2cf.tar.lz
craftbukkit-bdcc7c7b02947498f0c9b5adfd4a66bc1600d2cf.tar.xz
craftbukkit-bdcc7c7b02947498f0c9b5adfd4a66bc1600d2cf.zip
Unit tests for Material.isItem
Diffstat (limited to 'src/test/java/org/bukkit/PerMaterialTest.java')
-rw-r--r--src/test/java/org/bukkit/PerMaterialTest.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/java/org/bukkit/PerMaterialTest.java b/src/test/java/org/bukkit/PerMaterialTest.java
index eabe68d7..1e8d53c6 100644
--- a/src/test/java/org/bukkit/PerMaterialTest.java
+++ b/src/test/java/org/bukkit/PerMaterialTest.java
@@ -162,4 +162,22 @@ public class PerMaterialTest extends AbstractTestingBase {
assertFalse(EnchantmentTarget.BREAKABLE.includes(material));
}
}
+
+ @Test
+ public void testBlock() {
+ if (material == Material.AIR) {
+ assertTrue(material.isBlock());
+ } else {
+ assertThat(material.isBlock(), is(equalTo(CraftMagicNumbers.getBlock(material) != Blocks.AIR)));
+ }
+ }
+
+ @Test
+ public void testAir() {
+ if (material == Material.AIR) {
+ assertTrue(material.isItem());
+ } else {
+ assertThat(material.isItem(), is(equalTo(CraftMagicNumbers.getItem(material) != null)));
+ }
+ }
}