def test_some_coefficient_is_0(self): p = Polynomial([1, 0, 0, 0 ,2]) # x^4 + 2 self.assertEqual(83, p.calc(3))
def test_negative(self): p = Polynomial([-1,2]) self.assertEqual(-1, p.calc(3))
def test_2_size(self): p = Polynomial([1,2]) self.assertEqual(5, p.calc(3))
def test_5_size(self): p = Polynomial([1,2,3,4,5]) # x^4 + 2x^3 + 3x^2 + 4x^1 + 5 self.assertEqual(179, p.calc(3))
def test_1_size(self): p = Polynomial([2]) self.assertEqual(2, p.calc(3))