OSDN Git Service

b0837829ad4aa76ccf6c59f1299d87fe969a1b57
[chemicraft/chemicraft.git] / common / pcc / chemicraft / testcase / MaterialRecipeTest.java
1 package pcc.chemicraft.testcase;
2
3 import static org.junit.Assert.*;
4
5 import net.minecraft.item.ItemStack;
6
7 import org.junit.Test;
8
9 import pcc.chemicraft.base.ChemiCraftBase;
10 import pcc.chemicraft.core.inventory.InventoryChemicalCraftingMaterial;
11 import pcc.chemicraft.util.ChemicalNBTRecipe;
12 import pcc.chemicraft.util.MaterialRecipe;
13
14 public class MaterialRecipeTest extends MaterialRecipe {
15
16         public MaterialRecipeTest() {
17                 super(
18                                 new ItemStack(1800, 1, 0),
19                                 new ItemStack[] {
20                                         new ItemStack(1800, 1, 0)
21                                 },
22                                 null,
23                                 true);
24         }
25
26         @Test
27         public void test() {
28
29                 ItemStack stack = new ItemStack(18000, 1, 0);
30                 InventoryChemicalCraftingMaterial inv = new InventoryChemicalCraftingMaterial();
31                 inv.setInventorySlotContents(0, new ItemStack(18000, 1, 0));
32
33                 MaterialRecipe mr = new MaterialRecipe(
34                                 stack,
35                                 new ItemStack[] {
36                                                 new ItemStack(18000, 1, 0)
37                                 },
38                                 null,
39                                 true);
40
41                 assertEquals(
42                                 mr.match(inv),
43                                 stack
44                                 );
45
46         }
47
48 }