alvinj / FunctionalProgrammingSimplified

Notes and projects for my book, “Functional Programming, Simplified"
18 stars 2 forks source link

batchOfCookies not used. And unused cookies is not cool! #31

Open mgenereu opened 4 years ago

mgenereu commented 4 years ago

Should it be batchOfCookies or cookies for the variable name?

test("make a batch of chocolate chip cookies") {
    val ingredients = List(
        Flour(3.Cups),
        Butter(1.Cup),
        Egg(2),
        Sugar(1.Cup),
        ChocolateChip(2.Cups)
    )
    val batchOfCookies = GrandmasRecipes.makeCookies(ingredients)
    assert(cookies.count == 12)
    assert(cookies.taste == Taste.JustLikeGrandmasCookies)
    assert(cookies.doughColor == Color.WhiterThanOtherCookies)
}