Add isRecord and new material method tests.
Cleaned up all of the CraftBukkit tests, including moving some tests from MaterialTest to PerMaterialTest. By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
package org.bukkit.craftbukkit.inventory;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
|
||||
import net.minecraft.server.Enchantment;
|
||||
import net.minecraft.server.StatisticList;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.junit.Before;
|
||||
import org.bukkit.support.AbstractTestingBase;
|
||||
import org.junit.Test;
|
||||
|
||||
public class CraftItemStackTest {
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
StatisticList.a();
|
||||
}
|
||||
public class CraftItemStackTest extends AbstractTestingBase {
|
||||
|
||||
@Test
|
||||
public void testCloneEnchantedItem() throws Exception {
|
||||
@@ -18,12 +17,13 @@ public class CraftItemStackTest {
|
||||
nmsItemStack.addEnchantment(Enchantment.DAMAGE_ALL, 1);
|
||||
ItemStack itemStack = new CraftItemStack(nmsItemStack);
|
||||
ItemStack clone = itemStack.clone();
|
||||
assert (clone.getType().equals(itemStack.getType()));
|
||||
assert (clone.getAmount() == itemStack.getAmount());
|
||||
assert (clone.getDurability() == itemStack.getDurability());
|
||||
assert (clone.getEnchantments().equals(itemStack.getEnchantments()));
|
||||
assert (clone.getTypeId() == itemStack.getTypeId());
|
||||
assert (clone.getData().equals(itemStack.getData()));
|
||||
assertThat(clone.getType(), is(itemStack.getType()));
|
||||
assertThat(clone.getAmount(), is(itemStack.getAmount()));
|
||||
assertThat(clone.getDurability(), is(itemStack.getDurability()));
|
||||
assertThat(clone.getEnchantments(), is(itemStack.getEnchantments()));
|
||||
assertThat(clone.getTypeId(), is(itemStack.getTypeId()));
|
||||
assertThat(clone.getData(), is(itemStack.getData()));
|
||||
assertThat(clone, is(itemStack));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -31,6 +31,6 @@ public class CraftItemStackTest {
|
||||
net.minecraft.server.ItemStack nmsItemStack = null;
|
||||
ItemStack itemStack = new CraftItemStack(nmsItemStack);
|
||||
ItemStack clone = itemStack.clone();
|
||||
assert (clone.equals(itemStack));
|
||||
assertThat(clone, is(itemStack));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user