# -*- coding: utf-8 -*-
import unittest

from pygorithm.dynamic_programming import (
    binary_knapsack,
    lis
    )


class TestBinaryKnapsack(unittest.TestCase):
    def test_binary_knapsack(self):
        value = [60, 100, 120]
        weight = [10, 20, 30]
        W = 50
        self.assertEqual(binary_knapsack.knapsack(W, value, weight), 220)

class TestLongestIncreasingSubsequence(unittest.TestCase):
    def test_lis(self):
        _list = [10, 22, 9, 33, 21, 50, 41, 60]
        ans = lis.longest_increasing_subsequence(_list)
        self.assertEqual(ans[0], 5)
        self.assertEqual(ans[1], [10, 22, 33, 50, 60])

if __name__ == '__main__':
    unittest.main()

@@ -106,16 +106,35 @@
 %0A    lis
+,%0A    min_cost_path
 %0A    )%0A%0A
@@ -645,16 +645,337 @@
 , 60%5D)%0A%0A
+class TestMinCostPath(unittest.TestCase):%0A    def test_min_cost_path(self):%0A        matrix = %5B%5B5, 3, 10, 17, 1%5D,%0A                  %5B4, 2, 9, 8, 5%5D,%0A                  %5B11, 12, 3, 9, 6%5D,%0A                  %5B1, 3, 4, 2, 10%5D,%0A                  %5B7, 11, 13, 7, 3%5D%5D%0A        self.assertEqual(min_cost_path.find_path(matrix), 38)%0A%0A
 if __nam

test for min_cost_path