/** * Copyright (C) 2022, Tim Holloway * * Date written: Jan 12, 2022 * Author: Tim Holloway */ package com.mousetech.gourmetj; import static org.junit.jupiter.api.Assertions.*; import java.util.ArrayList; import java.util.List; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import com.mousetech.gourmetj.ShopIngredient; import com.mousetech.gourmetj.persistence.model.Shopcat; /** * @author timh * @since Jan 12, 2022 */ class ShoppingListBeanTest { static List testList; /** * @throws java.lang.Exception */ @BeforeAll static void setUpBeforeClass() throws Exception { testList = new ArrayList(); testList.add(new ShopIngredient(2.0d, "cup", "sugar", "sugar", "baking")); testList.add(new ShopIngredient(1.5, "tsp", "salt", "salt", "condiments")); testList.add(new ShopIngredient(0.5, "tsp", "pepper", "pepper", "condiments")); testList.add(new ShopIngredient(2.0d, "cup", "milk", "milk", "dairy")); testList.add(new ShopIngredient(0.75d, "cup", "sugar", "sugar", "baking")); } @Test void test() { ShoppingListBean.optimizeIngredients(testList); assertEquals(4, testList.size()); } }