interactive-coding-challenges/recursion_dynamic/coin_change/test_coin_change.py

21 lines
479 B
Python
Raw Normal View History

import unittest
2017-03-28 17:10:10 +08:00
class Challenge(unittest.TestCase):
2017-03-28 17:10:10 +08:00
def test_coin_change(self):
coin_changer = CoinChanger()
self.assertEqual(coin_changer.make_change([1, 2], 0), 0)
self.assertEqual(coin_changer.make_change([1, 2, 3], 5), 5)
self.assertEqual(coin_changer.make_change([1, 5, 25, 50], 10), 3)
2017-03-28 17:10:10 +08:00
print('Success: test_coin_change')
def main():
test = Challenge()
test.test_coin_change()
if __name__ == '__main__':
main()