mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 04:56:50 +01:00
Add failing unit test for ItemMeta-repairability
This commit is contained in:
parent
32d9db82e5
commit
1f9f6a51c2
1 changed files with 56 additions and 0 deletions
|
@ -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"
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue