summaryrefslogtreecommitdiff
path: root/AlgoDesignAndTechniqueEdxPython/tests/max_dot_prodTest.py
blob: 2f8f7a240ec66bcccd51fffa305d2caf76bdcada (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'''
Created on Sep 7, 2018

@author: haidong
'''
import unittest

from sources.max_dot_product import getMaxDotProduct

class Test(unittest.TestCase):


    def testName(self):
        a = [60, 100, 120]
        b = [20, 50, 30]
        self.assertEqual(getMaxDotProduct(a, b), 10200)

    def testName1(self):
        a = [23]
        b = [39]
        self.assertEqual(getMaxDotProduct(a, b), 897)

    def testName2(self):
        a = [1, 3, -5]
        b = [-2,4,1]
        self.assertEqual(getMaxDotProduct(a, b), 23)


if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()