diff options
author | md_5 <git@md-5.net> | 2018-01-16 09:57:47 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2018-01-16 09:57:47 +1100 |
commit | bdcc7c7b02947498f0c9b5adfd4a66bc1600d2cf (patch) | |
tree | 45734f5474cdf0a4822f96bdce73ac632022927a | |
parent | bd308430b5e8fe0499e2c45d6f38f224f6e4e2da (diff) | |
download | craftbukkit-bdcc7c7b02947498f0c9b5adfd4a66bc1600d2cf.tar craftbukkit-bdcc7c7b02947498f0c9b5adfd4a66bc1600d2cf.tar.gz craftbukkit-bdcc7c7b02947498f0c9b5adfd4a66bc1600d2cf.tar.lz craftbukkit-bdcc7c7b02947498f0c9b5adfd4a66bc1600d2cf.tar.xz craftbukkit-bdcc7c7b02947498f0c9b5adfd4a66bc1600d2cf.zip |
Unit tests for Material.isItem
-rw-r--r-- | src/test/java/org/bukkit/PerMaterialTest.java | 18 |
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))); + } + } } |