13
0
geforkt von Mirrors/Paper

Add failing unit test for ItemMeta-repairability

Dieser Commit ist enthalten in:
Wesley Wolfe 2014-01-14 17:56:49 -06:00
Ursprung 32d9db82e5
Commit 1f9f6a51c2

Datei anzeigen

@ -6,6 +6,7 @@ import java.util.List;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.Repairable;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Parameterized; import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters; import org.junit.runners.Parameterized.Parameters;
@ -235,6 +236,61 @@ public class ItemStackLoreEnchantmentTest extends ItemStackTest {
}, },
"Enchant vs Other" "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"
}
) )
); );
} }