@@ -60,13 +60,13 @@ public ArrayList<String> getDrinks() {
6060 }
6161
6262 @ Test
63- public void testLunchType () throws InvalidCalorieException {
64- lunch = new Lunch ("Tofu Stir Fry" , "Brown Rice" , 350 , Lunch .LunchType .VEGAN );
65- assertEquals (Lunch .LunchType .VEGAN , lunch .getLunchType ());
66- }
63+ public void testLunchType () throws InvalidCalorieException {
64+ lunch = new Lunch ("Tofu Stir Fry" , "Brown Rice" , 350 , Lunch .LunchType .VEGAN );
65+ assertEquals (Lunch .LunchType .VEGAN , lunch .getLunchType ());
66+ }
6767
68- @ Test
69- public void testAddMultipleDrinks () {
68+ @ Test
69+ public void testAddMultipleDrinks () {
7070 lunch .addDrink ("Soda" );
7171 lunch .addDrink ("Juice" );
7272 lunch .addDrink ("Coffee" );
@@ -78,32 +78,33 @@ public void testAddMultipleDrinks() {
7878
7979 assertEquals (expectedDrinks .size (), lunch .getDrinks ().size ());
8080 assertTrue (lunch .getDrinks ().containsAll (expectedDrinks ));
81- }
81+ }
8282
83- @ Test
84- public void testHighCalories () throws InvalidCalorieException {
83+ @ Test
84+ public void testHighCalories () throws InvalidCalorieException {
8585 lunch = new Lunch ("Double Cheeseburger" , "Loaded Fries" , 2000 , Lunch .LunchType .NON_VEGETARIAN );
8686 assertEquals (2000 , lunch .getCalories ());
87- }
87+ }
8888
89- @ Test
90- public void testEmptyMainDish () throws InvalidCalorieException {
89+ @ Test
90+ public void testEmptyMainDish () throws InvalidCalorieException {
9191 lunch = new Lunch ("" , "Salad" , 300 , Lunch .LunchType .VEGETARIAN );
9292 assertEquals ("" , lunch .getMainDish ());
93- }
93+ }
9494
95- // Expected to fail with exception message: Calories cannot be zero or negative
96- @ Test
97- public void testZeroCalories () throws InvalidCalorieException {
98- lunch = new Lunch ("Fruit Salad" , "Yogurt" , 0 , Lunch .LunchType .VEGAN );
99- assertEquals ("Fruit Salad" , lunch .getMainDish ());
100- assertEquals (0 , lunch .getCalories ());
101- }
95+ // Expected to fail with exception message: Calories cannot be zero or negative
96+ @ Test
97+ public void testZeroCalories () throws InvalidCalorieException {
98+ lunch = new Lunch ("Fruit Salad" , "Yogurt" , 0 , Lunch .LunchType .VEGAN );
99+ assertEquals ("Fruit Salad" , lunch .getMainDish ());
100+ assertEquals (0 , lunch .getCalories ());
101+ }
102102
103- // Expected to fail with exception message: Calories cannot be zero or negative
103+ // Expected to fail with exception message: Calories cannot be zero or negative
104104 @ Test
105- public void testNegativeCaloriesThrowsException () throws InvalidCalorieException {
106- impossibleLunch = new Lunch ("Grilled Chicken" , "Caesar Salad" , -100 , Lunch .LunchType .NON_VEGETARIAN );
107- assertEquals (-100 , lunch .getCalories ());
108- }
109- }
105+ public void testNegativeCaloriesThrowsException () throws InvalidCalorieException {
106+ impossibleLunch =
107+ new Lunch ("Grilled Chicken" , "Caesar Salad" , -100 , Lunch .LunchType .NON_VEGETARIAN );
108+ assertEquals (-100 , lunch .getCalories ());
109+ }
110+ }
0 commit comments