예제 #1
0
 def test_mixed_addition(self, money):
     five_bucks = money.dollar(5)
     ten_francs = money.franc(10)
     bank = Bank()
     bank.addRate("CHF", "USD", 2)
     result = bank.reduce(five_bucks.plus(ten_francs), "USD")
     assert money.dollar(10) == result
예제 #2
0
 def test_TotalTimes(self, money):
     five_bucks = money.dollar(5)
     ten_francs = money.franc(10)
     bank = Bank()
     bank.addRate("CHF", "USD", 2)
     summation = Summation(five_bucks, ten_francs).times(2)
     result = bank.reduce(summation, "USD")
     assert money.dollar(20) == result
예제 #3
0
 def test_ReduceMoneyDifferentCurrency(self):
     bank = Bank()
     bank.addRate("CHF", "USD", 2)
     result = bank.reduce(Money.franc(2), "USD")
     assert Money.dollar(1) == result