Beispiel #1
0
 def test_replace_item_in_slot_success(self):
     vending_machine = VendingMachine()
     vending_machine.add_item_to_slot(1, Item('Coffee', 1.75, 6))
     self.assertTrue(
         vending_machine.replace_item_in_slot(1, Item('Soda', 1.25, 20)))
Beispiel #2
0
 def test_replace_item_in_slot_empty_slot(self):
     vending_machine = VendingMachine()
     vending_machine.add_item_to_slot(1, Item('Coffee', 1.75, 6))
     self.assertTrue(
         vending_machine.replace_item_in_slot(1, Item('Soda', 1.25, 20)))
     self.assertTrue(8, vending_machine.available_slots)