Exemple #1
0
 def test_add_extra_with_new_ingredient_should_add_the_quantity(self):
     t = PizzaDelivery('Margarita', 12, {'cheese': 2, 'tomatoes': 1})
     t.add_extra('mozzarella', 1, 2.5)
     self.assertEqual(t.ingredients, {
         'cheese': 2,
         'tomatoes': 1,
         'mozzarella': 1
     })
     self.assertEqual(t.price, 14.5)
Exemple #2
0
 def test_add_extra_after_pizza_is_ordered_should_return_message(self):
     t = PizzaDelivery('Margarita', 12, {'cheese': 2, 'tomatoes': 1})
     order = t.make_order()
     result = t.add_extra('mozzarella', 1, 2)
     self.assertEqual(
         order,
         "You've ordered pizza Margarita prepared with cheese: 2, tomatoes: 1 and the price will be 12lv."
     )
     self.assertEqual(
         result,
         "Pizza Margarita already prepared and we can't make any changes!")
Exemple #3
0
 def test_add_extra_with_available_ingredient_should_increase_the_quantity(
         self):
     t = PizzaDelivery('Margarita', 12, {'cheese': 2, 'tomatoes': 1})
     t.add_extra('cheese', 1, 2)
     self.assertEqual(t.ingredients, {'cheese': 3, 'tomatoes': 1})
     self.assertEqual(t.price, 14)