def test_sum_times(self): five_bucks = Money.dollar(5) ten_franc = Money.franc(10) bank = Bank() bank.add_rate('CHF', 'USD', 2) total = Total(five_bucks, ten_franc).times(2) result = bank.reduce(total, 'USD') assert Money.dollar(20) == result
def test_sum_plus_money(self): five_bucks = Money.dollar(5) ten_franc = Money.franc(10) bank = Bank() bank.add_rate('CHF', 'USD', 2) total = Total(five_bucks, ten_franc).plus(five_bucks) result = bank.reduce(total, 'USD') assert Money.dollar(15) == result
def test_total_times(self): """moneyの倍""" five_bucks = Money.dollar(5) ten_francs = Money.franc(10) bank = Bank() bank.add_rate("CHF", "USD", 2) total = Total(five_bucks, ten_francs).times(2) result = bank.reduce(total, "USD") self.assertEqual(Money.dollar(20), result)
def test_totalplus_money(self): """合計の加算""" five_bucks = Money.dollar(5) ten_francs = Money.franc(10) bank = Bank() bank.add_rate("CHF", "USD", 2) total = Total(five_bucks, ten_francs).plus(five_bucks) result = bank.reduce(total, "USD") self.assertEqual(Money.dollar(15), result)
def test_reducesum(self): """合計のテスト""" total = Total(Money.dollar(3), Money.dollar(4)) bank = Bank() result = bank.reduce(total, "USD") self.assertEqual(Money.dollar(7), result)
def test_reduce_sum(self): total = Total(Money.dollar(3), Money.dollar(4)) bank = Bank() result = bank.reduce(total, "USD") assert Money.dollar(7) == result