コード例 #1
0
 @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);
 }
コード例 #2
0
 @Test(expected = RecipeException.class)
 public void testCanNotDeleteRecipeNotAdded() throws Exception {
   CM.addRecipe(coffee);
   CM.deleteRecipe(coffee.getName() + " 2");
 }
コード例 #3
0
 @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);
 }
コード例 #4
0
 @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);
 }
コード例 #5
0
 @Test(expected = RecipeException.class)
 public void testCantMakeRecipeThatIsNotAdded() throws Exception {
   CM.addRecipe(coffee);
   CM.makeCoffee("toddy", 10);
 }
コード例 #6
0
 @Test(expected = InvalidValueException.class)
 public void testCanNotMakeRecipeWithMoreThanAcceptedMoney() throws Exception {
   CM.addRecipe(coffee);
   CM.makeCoffee(coffee.getName(), 501);
 }
コード例 #7
0
 @Test(expected = InvalidValueException.class)
 public void testCanNotMakeRecipeWithNegativeMoney() throws Exception {
   CM.addRecipe(coffee);
   CM.makeCoffee(coffee.getName(), -1);
 }