@@ -60,13 +60,13 @@ public ArrayList<String> getDrinks() {
60
60
}
61
61
62
62
@ 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
+ }
67
67
68
- @ Test
69
- public void testAddMultipleDrinks () {
68
+ @ Test
69
+ public void testAddMultipleDrinks () {
70
70
lunch .addDrink ("Soda" );
71
71
lunch .addDrink ("Juice" );
72
72
lunch .addDrink ("Coffee" );
@@ -78,32 +78,33 @@ public void testAddMultipleDrinks() {
78
78
79
79
assertEquals (expectedDrinks .size (), lunch .getDrinks ().size ());
80
80
assertTrue (lunch .getDrinks ().containsAll (expectedDrinks ));
81
- }
81
+ }
82
82
83
- @ Test
84
- public void testHighCalories () throws InvalidCalorieException {
83
+ @ Test
84
+ public void testHighCalories () throws InvalidCalorieException {
85
85
lunch = new Lunch ("Double Cheeseburger" , "Loaded Fries" , 2000 , Lunch .LunchType .NON_VEGETARIAN );
86
86
assertEquals (2000 , lunch .getCalories ());
87
- }
87
+ }
88
88
89
- @ Test
90
- public void testEmptyMainDish () throws InvalidCalorieException {
89
+ @ Test
90
+ public void testEmptyMainDish () throws InvalidCalorieException {
91
91
lunch = new Lunch ("" , "Salad" , 300 , Lunch .LunchType .VEGETARIAN );
92
92
assertEquals ("" , lunch .getMainDish ());
93
- }
93
+ }
94
94
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
+ }
102
102
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
104
104
@ 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