@Test() public void testCanAddRecipeWithDifferentAmountOfCofee() throws Exception { CM.addRecipe(new Recipe("Hot Chocolate", 40, 0, 2, 1, 2)); boolean addedMilkedHotChocolate = CM.addRecipe(new Recipe("Pure Caffeine Hot Chocolate", 40, 10, 2, 1, 2)); assertTrue(addedMilkedHotChocolate); }
@Test(expected = RecipeException.class) public void testCanNotDeleteRecipeNotAdded() throws Exception { CM.addRecipe(coffee); CM.deleteRecipe(coffee.getName() + " 2"); }
@Test public void testCanAddRecipesWithDifferentNameAndAmmounts() throws Exception { CM.addRecipe(new Recipe("Hot Chocolate", 40, 0, 2, 1, 2)); boolean addedRecipe = CM.addRecipe(new Recipe("Super Hot Chocolate", 45, 30, 20, 10, 22)); assertTrue(addedRecipe); }
@Test() public void testCanAddRecipeWithDifferentAmountOfSugar() throws Exception { CM.addRecipe(new Recipe("Hot Chocolate", 40, 0, 2, 1, 2)); boolean addedRecipe = CM.addRecipe(new Recipe("Diabetic Hot Chocolate", 40, 0, 2, 11, 2)); assertTrue(addedRecipe); }
@Test(expected = RecipeException.class) public void testCantMakeRecipeThatIsNotAdded() throws Exception { CM.addRecipe(coffee); CM.makeCoffee("toddy", 10); }
@Test(expected = InvalidValueException.class) public void testCanNotMakeRecipeWithMoreThanAcceptedMoney() throws Exception { CM.addRecipe(coffee); CM.makeCoffee(coffee.getName(), 501); }
@Test(expected = InvalidValueException.class) public void testCanNotMakeRecipeWithNegativeMoney() throws Exception { CM.addRecipe(coffee); CM.makeCoffee(coffee.getName(), -1); }