Exemplo n.º 1
0
    def test_dot_prod(self):

        list_1 = [1.0, 2.0]
        list_2 = [3.0, 4.0]
        expected = 11.0

        result = loop.dot_prod(list_1, list_2)

        self.assertEqual(result, expected)
Exemplo n.º 2
0
 def test_one_case_loop(self: unittest.TestCase) -> bool:
     """ dot product of provided vectors is expected"""
     self.assertEqual(loop.dot_prod(self._v1, self._v2), self._result)
Exemplo n.º 3
0
 def test_zero_case_loop(self: unittest.TestCase) -> bool:
     """Dot product of zero vectors is zero?"""
     self.assertEqual(loop.dot_prod(self._zero_vector, self._zero_vector),
                      0.0)
Exemplo n.º 4
0
 def test_one_case_loop(self:unittest.TestCase) -> bool:
     """ dot product of provided vectors is expected"""
     self.assertEqual(loop.dot_prod(self._v1, self._v2), self._result)
Exemplo n.º 5
0
 def test_zero_case_loop(self: unittest.TestCase) -> bool:
     """Dot product of zero vectors is zero?"""
     self.assertEqual(loop.dot_prod(self._zero_vector, self._zero_vector), 0.0)