Package com.manning.siia.kitchen.domain

Examples of com.manning.siia.kitchen.domain.Ingredient


  private final Recipe recipe = new Recipe("grub");

  @Test
  public void shouldNotBeSatisfiedByEmptyList() throws Exception {
    Ingredient ingredient = mock(Ingredient.class);
    recipe.addIngredient(ingredient);
    assertThat(recipe.isSatisfiedBy(Collections.<Product>emptyList()), is(false));
  }
View Full Code Here


    assertThat(recipe.isSatisfiedBy(Collections.<Product>emptyList()), is(false));
  }
 
  @Test
  public void shouldBeSatisfiedByCorrectIngredients() throws Exception {
    Ingredient ingredient = mock(Ingredient.class);
    Product product = mock(Product.class);
    given(ingredient.isSatisfiedBy(product)).willReturn(true);

    recipe.addIngredient(ingredient);
    assertThat(recipe.isSatisfiedBy(Arrays.asList(product)), is(true));
  }
View Full Code Here

  }

  @Test
  public void shouldMarshallDomain() {
    Recipe r = new Recipe("Nasi");
    Ingredient i = new Ingredient("Beef", new Amount(500, Unit.GRAMS), Type.Meat);
    r.addIngredient(i);
    r.addIngredient(new Ingredient("Red Sweet Pepper", new Amount(1, Unit.PIECES), Type.Vegetable));

    System.out.println(xstream.toXML(r));
  }
View Full Code Here

*/
public class RecipeObjectMother {

  public static Recipe friedEggRecipe() {
    Recipe recipe = new Recipe("fried egg");
    recipe.addIngredient(new Ingredient("egg", new Amount(1, Amount.Unit.PIECES), Ingredient.Type.Grocery));
    recipe.addIngredient(new Ingredient("butter", new Amount(20, Amount.Unit.GRAMS), Ingredient.Type.Grocery));
    return recipe;
  }
View Full Code Here

    return recipe;
  }

  public static Recipe steak() {
    Recipe recipe = new Recipe("steak");
    recipe.addIngredient(new Ingredient("steak", new Amount(1, Amount.Unit.PIECES), Ingredient.Type.Meat));
    recipe.addIngredient(new Ingredient("pepper", new Amount(2, Amount.Unit.GRAMS), Ingredient.Type.Grocery));
    recipe.addIngredient(new Ingredient("salt", new Amount(2, Amount.Unit.GRAMS), Ingredient.Type.Grocery));
    return recipe;
  }
View Full Code Here

TOP

Related Classes of com.manning.siia.kitchen.domain.Ingredient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.