@Test public void checkGetCraftingProduct() { TestHelper.load(); Crafting craft = new Crafting(); assertTrue(craft.getCraftingProduct("glass","crystal","empty","empty").equals("potion")); assertTrue(craft.getCraftingProduct("crystal","glass","empty","empty").equals("invalid recipe")); assertTrue(craft.getCraftingProduct("crystal","empty","empty","glass").equals("invalid recipe")); assertTrue(craft.getCraftingProduct("potion1","firestone","empty","empty").equals("invalid recipe")); }
public String getCraftingProduct(String firstID, String secondID, String thirdID, String fourthID){ ArrayList<String> recipeList = new ArrayList<>(); recipeList.add(firstID); recipeList.add(secondID); recipeList.add(thirdID); recipeList.add(fourthID); if (craftingProduct.get(recipeList) != null){ return craftingProduct.get(recipeList); } else { return "invalid recipe"; } }
Crafting { public String getCraftingProduct(String firstID, String secondID, String thirdID, String fourthID){ ArrayList<String> recipeList = new ArrayList<>(); recipeList.add(firstID); recipeList.add(secondID); recipeList.add(thirdID); recipeList.add(fourthID); if (craftingProduct.get(recipeList) != null){ return craftingProduct.get(recipeList); } else { return "invalid recipe"; } } }
Crafting { public String getCraftingProduct(String firstID, String secondID, String thirdID, String fourthID){ ArrayList<String> recipeList = new ArrayList<>(); recipeList.add(firstID); recipeList.add(secondID); recipeList.add(thirdID); recipeList.add(fourthID); if (craftingProduct.get(recipeList) != null){ return craftingProduct.get(recipeList); } else { return "invalid recipe"; } } Crafting(); }
Crafting { public String getCraftingProduct(String firstID, String secondID, String thirdID, String fourthID){ ArrayList<String> recipeList = new ArrayList<>(); recipeList.add(firstID); recipeList.add(secondID); recipeList.add(thirdID); recipeList.add(fourthID); if (craftingProduct.get(recipeList) != null){ return craftingProduct.get(recipeList); } else { return "invalid recipe"; } } Crafting(); String getCraftingProduct(String firstID, String secondID, String thirdID, String fourthID); }
Crafting { public String getCraftingProduct(String firstID, String secondID, String thirdID, String fourthID){ ArrayList<String> recipeList = new ArrayList<>(); recipeList.add(firstID); recipeList.add(secondID); recipeList.add(thirdID); recipeList.add(fourthID); if (craftingProduct.get(recipeList) != null){ return craftingProduct.get(recipeList); } else { return "invalid recipe"; } } Crafting(); String getCraftingProduct(String firstID, String secondID, String thirdID, String fourthID);  }