From 0b306d01ec2acd71eca5469bd4eed27f48e87408 Mon Sep 17 00:00:00 2001 From: Nick Minkler Date: Wed, 26 Feb 2014 18:12:43 -0800 Subject: [PATCH] add itemstack test --- test/net/milkbowl/vault/test/ItemTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/net/milkbowl/vault/test/ItemTest.java b/test/net/milkbowl/vault/test/ItemTest.java index b382d84..af7f06d 100644 --- a/test/net/milkbowl/vault/test/ItemTest.java +++ b/test/net/milkbowl/vault/test/ItemTest.java @@ -7,6 +7,7 @@ import java.util.EnumSet; import java.util.Set; import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; import org.junit.Test; import net.milkbowl.vault.item.ItemInfo; @@ -59,6 +60,21 @@ public class ItemTest { assertEquals(false, failed); } + @Test + public void testItemStacks() { + boolean failed = false; + for (ItemInfo item : Items.getItemList()) { + ItemStack stack = item.toStack(); + try { + assertEquals(item, Items.itemByStack(stack)); + } catch (AssertionError e) { + e.printStackTrace(); + failed = true; + } + } + assertEquals(false, failed); + } + @Test public void MissingMaterialtest() { for (Material mat : Material.values()) {