Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package mi.hdm.recipes;
import mi.hdm.exceptions.InvalidIngredientException;
import org.junit.Test;
import org.junit.Assert;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
public class IngredientTest {
List<Ingredient> ingredients = new ArrayList<Ingredient>();
NutritionTable tt = new NutritionTable(null);
//Nutrition.CALORIES, 300, Nutrition.CARBS, 40, Nutrition.FAT, 15, Nutrition.PROTEINS, 7, Nutrition.FIBERS, 3.2, Nutrition.SALT, 0.6
@Test public void testEquals () {
Ingredient i1 = new Ingredient(Measurement.GRAM, "Banana", tt);
Ingredient i2 = new Ingredient(Measurement.PIECE, "Banana", tt);
Ingredient i3 = new Ingredient(Measurement.GRAM, "Apple", tt);
assertEquals(i1, i2);
assertNotEquals(i1, i3);
assertNotEquals(i2, i3);
}
/*@Test public void shouldNotBeAbleToAddIdenticalName () {
ingredients.add(Measurement.GRAM, "Banana", tt);
ingredients.add(Measurement.PIECE, "Banana", tt);
Assert.assertEquals(1, ingredients.size());
}*/
}