|
@ -1,5 +1,6 @@ |
|
|
import unittest |
|
|
import unittest |
|
|
from src.main.py.trigonometry import * |
|
|
from src.main.py.trigonometry import * |
|
|
|
|
|
import math |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MyTestCase(unittest.TestCase): |
|
|
class MyTestCase(unittest.TestCase): |
|
@ -39,6 +40,10 @@ class MyTestCase(unittest.TestCase): |
|
|
def test_sin_0_should_be_0(self): |
|
|
def test_sin_0_should_be_0(self): |
|
|
self.assertEqual(sin_approx_bhaskara(0), 0) |
|
|
self.assertEqual(sin_approx_bhaskara(0), 0) |
|
|
|
|
|
|
|
|
|
|
|
def test_sin_quarter_pi_should_be_point707(self): |
|
|
|
|
|
delta = sin_approx_bhaskara(0.25*math.pi) - 0.707 |
|
|
|
|
|
self.assertLess(delta, 0.01) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
if __name__ == '__main__': |
|
|
unittest.main() |
|
|
unittest.main() |