Example #1
0
def test_dollar():
    assert Dollar(7).amount == Dollar(5).plus(2)
    assert Dollar(8).amount == Dollar(5).plus(3)
Example #2
0
def test_dollar_to_franc():
    assert Money(20).amount == Bank().source_to_destiny(Dollar(10), 'CHF')
    assert Money(137.33).amount == Bank().source_to_destiny(Dollar(68.665), 'CHF')
    assert Money(68.665).amount == Bank().source_to_destiny(Dollar(68.665), 'USD')
Example #3
0
def test_exchange_rate():
    assert Money(5).amount == Bank().exchange_rate(Franc(10))
    assert Money(68.665).amount == Bank().exchange_rate(Franc(137.33))
    assert Money(10).amount == Bank().exchange_rate(Dollar(10))
 def test_dollar(self):
     self.assertEqual(Dollar(10).amount, Dollar(5).times(2))
     self.assertEqual(Dollar(15).amount, Dollar(5).times(3))
Example #5
0
 def test_dollar(self):
     assert Dollar(10).equals_currency(Dollar(10))
     assert Dollar(10).equals_currency(Dollar(15))
Example #6
0
    def test_inter(self):
        self.assertFalse(Dollar(10).equals_currency(Franc(10)))
        self.assertFalse(Dollar(10).equals_currency(Franc(15)))

        self.assertFalse(Money(10).equals_currency(Franc(10)))
        self.assertFalse(Money(10).equals_currency(Franc(15)))
Example #7
0
 def test_dollar(self):
     assert Dollar(4).equals(Dollar(4))    
     assert Dollar(5).equals(Dollar(5))
     
     self.assertFalse(Dollar(5).equals(Dollar(4)))
     self.assertFalse(Dollar(5).equals(Dollar(6)))
Example #8
0
 def test_inter(self):
     self.assertFalse(Dollar(5).equals(Franc(5)))
     self.assertFalse(Dollar(5).equals(Franc(6)))