diff options
author | Wesley Wolfe <weswolf@aol.com> | 2014-01-14 17:56:49 -0600 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2014-01-14 18:13:13 -0600 |
commit | 1f9f6a51c269e35d2c660164d797aebf793cdee7 (patch) | |
tree | 62d7af740d77f7974efaee0b5796be6334441cbd /src/test/java/org | |
parent | 32d9db82e5a2a7b1746d170349876337b2684b6c (diff) | |
download | craftbukkit-1f9f6a51c269e35d2c660164d797aebf793cdee7.tar craftbukkit-1f9f6a51c269e35d2c660164d797aebf793cdee7.tar.gz craftbukkit-1f9f6a51c269e35d2c660164d797aebf793cdee7.tar.lz craftbukkit-1f9f6a51c269e35d2c660164d797aebf793cdee7.tar.xz craftbukkit-1f9f6a51c269e35d2c660164d797aebf793cdee7.zip |
Add failing unit test for ItemMeta-repairability
Diffstat (limited to 'src/test/java/org')
-rw-r--r-- | src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLoreEnchantmentTest.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLoreEnchantmentTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLoreEnchantmentTest.java index 7de61aaa..32a9184f 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLoreEnchantmentTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackLoreEnchantmentTest.java @@ -6,6 +6,7 @@ import java.util.List; import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.inventory.meta.Repairable; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @@ -235,6 +236,61 @@ public class ItemStackLoreEnchantmentTest extends ItemStackTest { }, "Enchant vs Other" } + ), + Arrays.asList( + new Object[] { + new Operator() { + public ItemStack operate(ItemStack cleanStack) { + ItemMeta meta = cleanStack.getItemMeta(); + ((Repairable) meta).setRepairCost(42); + cleanStack.setItemMeta(meta); + return cleanStack; + } + }, + new Operator() { + public ItemStack operate(ItemStack cleanStack) { + return cleanStack; + } + }, + "Repair vs Null" + }, + new Object[] { + new Operator() { + public ItemStack operate(ItemStack cleanStack) { + ItemMeta meta = cleanStack.getItemMeta(); + ((Repairable) meta).setRepairCost(36); + cleanStack.setItemMeta(meta); + return cleanStack; + } + }, + new Operator() { + public ItemStack operate(ItemStack cleanStack) { + ItemMeta meta = cleanStack.getItemMeta(); + cleanStack.setItemMeta(meta); + return cleanStack; + } + }, + "Repair vs Blank" + }, + new Object[] { + new Operator() { + public ItemStack operate(ItemStack cleanStack) { + ItemMeta meta = cleanStack.getItemMeta(); + ((Repairable) meta).setRepairCost(89); + cleanStack.setItemMeta(meta); + return cleanStack; + } + }, + new Operator() { + public ItemStack operate(ItemStack cleanStack) { + ItemMeta meta = cleanStack.getItemMeta(); + ((Repairable) meta).setRepairCost(88); + cleanStack.setItemMeta(meta); + return cleanStack; + } + }, + "Repair vs Other" + } ) ); } |