Implement Unit Testing for fancymath #8

Merged
TimDiller merged 17 commits from unit_tests into main 2025-10-24 17:10:59 +00:00
6 changed files with 64 additions and 0 deletions
Showing only changes of commit 4d5e2db71a - Show all commits

View File

@@ -11,6 +11,11 @@ class TestVector(unittest.TestCase):
self.assertIsInstance(v3, Vector) self.assertIsInstance(v3, Vector)
self.assertEqual(v3.x, v1.x + v2.x) self.assertEqual(v3.x, v1.x + v2.x)
def test_dot_failure(self):
with self.assertRaises(ValueError):
v1 = Vector(1, 2, 3)
v1.dot(3)
def test_dot_product(self): def test_dot_product(self):
v1 = Vector(1, 2, 3) v1 = Vector(1, 2, 3)
v2 = Vector(-3, -2, -1) v2 = Vector(-3, -2, -1)