def test_reject_money(self):
     vdd = vending_machine()
     for input_coin in (Coin_10(), Coin_50(), Coin_100(), Coin_500(),
                        Coin_1000()):
         vdd.insert(input_coin)
     assert vdd.reject_money() == 1660
     assert vdd.money == 0
 def test_insert(self):
     vdd = vending_machine()
     # pytest parameterizeを使ってスマートに書く
     # 1つの関数で複数のテストが出来るようにする
     for yen in (10, 50, 100, 500, 1000):
         assert vdd.insert(yen)
     for yen in (1, 5, 2000, 5000, 10000):
         assert ~vdd.insert(yen)
    def test_get_total_amount(self) -> None:
        machine = vending_machine()
        machine.insert(10)
        machine.insert(50)
        machine.insert(100)
        machine.insert(500)
        machine.insert(1000)

        assert machine.get_total_amount() == 1660
    def test_insert(self, input, total_amount, return_money) -> None:
        machine = vending_machine()
        change = machine.insert(input)

        assert machine.get_total_amount() == total_amount
        assert change == return_money
 def test_reject_money(self):
     vdd = vending_machine()
     for yen in (10, 50, 100, 500, 1000):
         vdd.insert(yen)
     assert vdd.reject_money() == 1660
     assert vdd.money == 0
 def test_get_total(self):
     vdd = vending_machine()
     for yen in (10, 50, 100, 500, 1000):
         vdd.insert(yen)
     assert vdd.get_total() == 1660
 def test_get_total(self):
     vdd = vending_machine()
     for input_coin in (Coin_10(), Coin_50(), Coin_100(), Coin_500(),
                        Coin_1000()):
         vdd.insert(input_coin)
     assert vdd.get_total() == 1660
    def test_insert_invalid(self, inputs):
        vdd = vending_machine()
        input_coin = inputs

        assert vdd.insert(input_coin) == input_coin
    def test_insert(self, inputs):
        vdd = vending_machine()
        input_coin = inputs()

        assert vdd.insert(input_coin)
        assert vdd.get_total() == input_coin.get_value()