All unit tests are now successful

This commit is contained in:
chylex committed 2015-03-25 19:06:40 +01:00
1 parent a7cd01eed7
commit 37fbb271ed
3 files changed
+8 -8

No files matched your search

@@ -1,6 +1,6 @@
package chylex.hee.system.test.list;
import net.minecraft.init.Items;
import chylex.hee.api.HeeIMC;
import chylex.hee.item.ItemList;
import chylex.hee.mechanics.essence.handler.DragonEssenceHandler;
import chylex.hee.system.test.Assert;
import chylex.hee.system.test.data.MethodType;
@@ -20,7 +20,7 @@ public class ImcTests{
@UnitTest(type = MethodType.TEST, runTime = RunTime.LOADCOMPLETE)
public void testMessages(){
Assert.equal(DragonEssenceHandler.recipes.size(),3,"Unexpected list size, expected $2, got $1.");
Assert.equal(DragonEssenceHandler.recipes.get(1).input.getItem(),ItemList.ghost_amulet,"Unexpected second entry, expected $2, got $1. Full list: "+DragonEssenceHandler.recipes);
Assert.equal(DragonEssenceHandler.recipes.get(1).input.getItem(),Items.ender_eye,"Unexpected second entry, expected $2, got $1. Full list: "+DragonEssenceHandler.recipes);
Assert.equal(DragonEssenceHandler.recipes.get(2).cost,15,"Unexpected recipe cost, expected $2, got $1.");
}
}
@@ -36,7 +36,7 @@ public class ItemHandlingTests{
Assert.equal(new ItemPattern().setItemName("minecraft","sand").retainMatching(items).size(),0,error);
Assert.equal(new ItemPattern().setDamageValues(new int[]{ 1 }).retainMatching(items).size(),1,error);
Assert.equal(new ItemPattern().setDamageValues(new int[]{ 1, 2 }).retainMatching(items).size(),2,error);
Assert.equal(new ItemPattern().setNBT(nbt),1,error);
Assert.equal(new ItemPattern().setNBT(nbt).retainMatching(items).size(),1,error);
}
@UnitTest(type = MethodType.TEST, runTime = RunTime.LOADCOMPLETE)
@@ -9,19 +9,19 @@ import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier;
public class ItemPattern{
private String prefix = "";
private String name = "";
private boolean nameWildcard;
private String name = "*";
private boolean nameWildcard = true;
private short[] damageValues = ArrayUtils.EMPTY_SHORT_ARRAY;
private NBTTagCompound nbt;
/**
* If the name is '*', it will accept all items from the mod specified by prefix, or from the game if an empty prefix is provided.
* If the name is '*', it will accept all items from the mod specified by prefix, or from the game if an empty prefix is provided (default).
*/
public ItemPattern setItemName(String prefix, String name){
this.prefix = prefix;
this.name = name;
if (name.equals("*"))nameWildcard = true;
else if (prefix.isEmpty())prefix = "minecraft";
nameWildcard = name.equals("*");
if (!nameWildcard && prefix.isEmpty())prefix = "minecraft";
return this;
}