geforkt von Mirrors/Paper
46 Zeilen
1.2 KiB
Java
46 Zeilen
1.2 KiB
Java
|
package org.bukkit;
|
||
|
|
||
|
import static org.junit.Assert.*;
|
||
|
import static org.hamcrest.Matchers.*;
|
||
|
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.List;
|
||
|
|
||
|
import net.minecraft.server.AchievementList;
|
||
|
import net.minecraft.server.Block;
|
||
|
|
||
|
import org.junit.Test;
|
||
|
import org.junit.runner.RunWith;
|
||
|
import org.junit.runners.Parameterized;
|
||
|
import org.junit.runners.Parameterized.Parameter;
|
||
|
import org.junit.runners.Parameterized.Parameters;
|
||
|
|
||
|
@RunWith(Parameterized.class)
|
||
|
public class PerMaterialTest {
|
||
|
static {
|
||
|
AchievementList.a();
|
||
|
}
|
||
|
|
||
|
@Parameters(name= "{index}: {0}")
|
||
|
public static List<Object[]> data() {
|
||
|
List<Object[]> list = new ArrayList<Object[]>();
|
||
|
for (Material material : Material.values()) {
|
||
|
list.add(new Object[] {material});
|
||
|
}
|
||
|
return list;
|
||
|
}
|
||
|
|
||
|
@Parameter public Material material;
|
||
|
|
||
|
@Test
|
||
|
public void isSolid() {
|
||
|
if (material == Material.AIR) {
|
||
|
assertFalse(material.isSolid());
|
||
|
} else if (material.isBlock()) {
|
||
|
assertThat(material.isSolid(), is(Block.byId[material.getId()].material.isSolid()));
|
||
|
} else {
|
||
|
assertFalse(material.isSolid());
|
||
|
}
|
||
|
}
|
||
|
}
|