Update material values

This commit is contained in:
h31ix committed 2013-03-15 15:57:12 -04:00
1 parent e481af55cc
commit 5f1ac209d4
3 files changed
+74 -6

No files matched your search

@@ -0,0 +1,45 @@
/*
* AntiCheat for Bukkit.
* Copyright (C) 2012-2013 AntiCheat Team | http://gravitydevelopment.net
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.h31ix.anticheat.util;
import org.bukkit.Material;
import org.junit.Assert;
import org.junit.Test;
public class BlockHardnessTest {
@Test
public void verifyExistence() {
for(Material m : Material.values()) {
if(!BlockHardness.hasBlockHardness(m) && m.isBlock() && m != Material.AIR && m != Material.BEDROCK) {
Assert.fail("Material " + m + " is not accounted for by BlockHardness");
}
}
}
@Test
public void verifyName() {
for(Material m : Material.values()) {
BlockHardness hardness = BlockHardness.getHardness(m);
if(hardness != null && !hardness.name().equals(m.name())) {
Assert.fail("BlockHardness " + hardness + " and its material " + m + " have mismatched names");
}
}
}
}