Exemple #1
0
 def test_sum_times(self):
     five_bucks = MoneyFactory.dollar(5)
     ten_francs = MoneyFactory.franc(10)
     bank = Bank()
     bank.add_rate('CHF', 'USD', 2)
     sum_ = Sum(five_bucks, ten_francs).times(2)
     result = bank.reduce(sum_, 'USD')
     eq_(MoneyFactory.dollar(20), result)
Exemple #2
0
def test_sum_times():
    five_bucks = Money.dollar(5)
    ten_francs = Money.franc(10)
    bank = Bank()
    bank.add_rate("CHF", "USD", 2)
    sum = Sum(five_bucks, ten_francs).times(2)
    result = bank.reduce(sum, "USD")
    assert Money.dollar(20) == result
Exemple #3
0
 def test_sum_plus_money(self):
     five_bucks = MoneyFactory.dollar(5)
     ten_francs = MoneyFactory.franc(10)
     bank = Bank()
     bank.add_rate('CHF', 'USD', 2)
     sum_ = Sum(five_bucks, ten_francs).plus(five_bucks)
     result = bank.reduce(sum_, 'USD')
     eq_(MoneyFactory.dollar(15), result)
Exemple #4
0
 def test_sum_times(self):
     five_bucks = Money.dollar(5)
     ten_francs = Money.franc(10)
     bank = Bank()
     bank.add_rate("CHF", "USD", 2)
     _sum = Sum(five_bucks, ten_francs).times(2)
     result = bank.reduce(_sum, "USD")
     self.assertEqual(Money.dollar(20), result)
def test_sum_times():
    five_bucks = Money.dollar(5)
    ten_franc = Money.franc(10)
    bank = Bank()
    bank.add_rate("CHF", "USD", 2)
    expression_sum = Sum(five_bucks, ten_franc).times(2)
    result = bank.reduce(expression_sum, "USD")
    assert result == Money.dollar(20)
Exemple #6
0
def test_sum_plus_money():
    five_bucks = Money.dollar(5)
    ten_francs = Money.franc(10)
    bank = Bank()
    bank.add_rate("CHF", "USD", 2)
    sum = Sum(five_bucks, ten_francs).plus(five_bucks)
    result = bank.reduce(sum, "USD")
    assert Money.dollar(15) == result
 def test_sum_plus_money(self):
     five_bucks: Expression = Money.dollar(5)
     ten_franc: Expression = Money.franc(10)
     bank = Bank()
     bank.add_rate("CHF", "USD", 2)
     cul_sum = Sum(five_bucks, ten_franc).plus(five_bucks)
     result = bank.reduce(cul_sum, "USD")
     self.assertEqual(Money.dollar(15), result)
Exemple #8
0
 def test_reduce_sum(self):
     sum_ = Sum(MoneyFactory.dollar(5), MoneyFactory.dollar(4))
     bank = Bank()
     result = bank.reduce(sum_, 'USD')
     eq_(MoneyFactory.dollar(9), result)
Exemple #9
0
 def test_reduce_sum(self):
     _sum = Sum(Money.dollar(3), Money.dollar(4))
     bank = Bank()
     result = bank.reduce(_sum, 'USD')
     self.assertEqual(Money.dollar(7), result)
Exemple #10
0
 def test_reduce_sum(self):
     sum = Sum(Money.doller(3), Money.doller(4))
     self.assertIsInstance(sum, Expression)
     bank = Bank()
     result = bank.reduce(sum, "USD")
     self.assertEqual(Money.doller(7), result)
Exemple #11
0
def test_reduce_sum():
    sum = Sum(Money.dollar(3), Money.dollar(4))
    bank = Bank()
    result = bank.reduce(sum, "USD")
    assert Money.dollar(7) == result
def test_reduce_sum():
    sum_expression = Sum(Money.dollar(3), Money.dollar(4))
    bank = Bank()
    result = bank.reduce(sum_expression, "USD")
    assert result == Money.dollar(7)
Exemple #13
0
 def test_reduce_sum(self):
     sum = Sum(Money.dollar(3), Money.dollar(4))
     bank = Bank()
     result = bank.reduce(sum, "USD")
     self.assertTrue(Money.dollar(7) == result)
 def test_reduce_sum(self):
     cul_sum = Sum(Money.dollar(3), Money.dollar(4))
     bank: Bank = Bank()
     result: Money = bank.reduce(cul_sum, "USD")
     self.assertEqual(Money.dollar(7), result)