def test_eq_deg2_float_False(self): # Arrange firstPol = Polynome([5]) secondPol = float(3.1) # Act eq = firstPol.__eq__(secondPol) # Assert self.assertFalse(eq)
def test_isub_deg2_deg2_2polynome(self): # Arrange firstPol = Polynome([-3, 2, 5]) secondPol = Polynome([-1, 5, -2]) # Act firstPol -= secondPol # Assert self.assertEqual(str(firstPol), '-2x^2 - 3x + 7')
def test_ne_deg2_deg2_False(self): # Arrange firstPol = Polynome([27, -91, -2]) secondPol = Polynome([27, -91, -2]) # Act eq = firstPol != secondPol # Assert self.assertFalse(eq)
def test_rsub_deg3_deg3_1polynome(self): # Arrange firstPol = Polynome([-3, -2, -1, 0]) secondPol = Polynome([-3, -2, -7, -21]) # Act eq = firstPol.__rsub__(secondPol) # Assert self.assertEqual(str(eq), '-6x - 21')
def test_rsub_deg2_deq2_0polynome(self): # Arrange firstPol = Polynome([27, -5, -2]) secondPol = Polynome([27, -5, -30]) # Act eq = firstPol.__rsub__(secondPol) # Assert self.assertEqual(str(eq), '-28')
def test_sub_deg2_deg2_zero_polynome(self): # Arrange firstPol = Polynome([-2, -1, -2]) secondPol = Polynome([-2, -1, -2]) # Act eq = firstPol - secondPol # Assert self.assertEqual(str(eq), '0')
def test_rsub_deg2_deg2_2polynome(self): # Arrange firstPol = Polynome([-3, 2, 5]) secondPol = Polynome([-1, 5, -2]) # Act eq = firstPol.__rsub__(secondPol) # Assert self.assertEqual(str(eq), '2x^2 + 3x - 7')
def test_imul_deg2_deg_0_2polenome(self): # Arrange firstPol = Polynome([2, 1, 4]) secondPol = Polynome([2]) # Act firstPol *= secondPol # Assert self.assertEqual(str(firstPol), '4x^2 + 2x + 8')
def test_add_deg0_deq0_zero_polynome(self): # Arrange firstPol = Polynome([0]) second = Polynome([0]) # Act eq = firstPol + second # Assert self.assertEqual(str(eq), '0')
def test_mul_deg2_deg_2_4polenome(self): # Arrange firstPol = Polynome([2, 2, 4]) secondPol = Polynome([2, 1, 1]) # Act eq = firstPol * secondPol # Assert self.assertEqual(str(eq), '4x^4 + 6x^3 + 12x^2 + 6x + 4')
def test_mul_deg2_deg_zero_zero_polenome(self): # Arrange firstPol = Polynome([2, 2, 4]) second = Polynome([0]) # Act eq = firstPol * second # Assert self.assertEqual(str(eq), '0')
def test_mul_deg2_deg_1_3polenome(self): # Arrange firstPol = Polynome([2, 1, 4]) second = Polynome([2, 0]) # Act eq = firstPol * second # Assert self.assertEqual(str(eq), '4x^3 + 2x^2 + 8x')
def test_ge_deg2_deg2_True(self): # Arrange firstPol = Polynome([3, 2, -1]) secondPol = Polynome([2, -1]) # Act eq = firstPol >= secondPol # Assert self.assertTrue(eq)
def test_gt_deg2_deg2_False(self): # Arrange firstPol = Polynome([3, 2, -1]) secondPol = Polynome([2, -1]) # Act eq = secondPol > firstPol # Assert self.assertFalse(eq)
def test_sub_deg2_deg2_1polynome(self): # Arrange firstPol = Polynome([-3, -2, -1]) secondPol = Polynome([-8, -2, -3]) # Act eq = firstPol - secondPol # Assert self.assertEqual(str(eq), '5x^2 + 2')
def test_radd_deg2_deg2_2polynome(self): # Arrange firstPol = Polynome([-3, -2, -1]) secondPol = Polynome([18, 15, -2]) # Act eq = firstPol .__radd__(secondPol) # Assert self.assertEqual(str(eq), '15x^2 + 13x - 3')
def test_sub_deg3_deg3_1polynome(self): # Arrange firstPol = Polynome([-3, -2, -1, 0]) secondPol = Polynome([-3, -2, -7, -21]) # Act eq = firstPol - secondPol # Assert self.assertEqual(str(eq), '6x + 21')
def test_radd_deg2_deg2_1polynome(self): # Arrange firstPol = Polynome([-3, -2, -1]) secondPol = Polynome([8, 2, -8]) # Act eq = firstPol.__radd__(secondPol) # Assert self.assertEqual(str(eq), '5x^2 - 9')
def test_sub_deg2_deq0_2polynome(self): # Arrange firstPol = Polynome([28, 71, -2]) secondPol = Polynome([0]) # Act eq = firstPol - secondPol # Assert self.assertEqual(str(eq), '28x^2 + 71x - 2')
def test_radd_deg3_deg3_1polynome(self): # Arrange firstPol = Polynome([-6, -8, -1, 0]) secondPol = Polynome([6, 8, 8, 7]) # Act eq = firstPol.__radd__(secondPol) # Assert self.assertEqual(str(eq), '7x + 7')
def test_rsub_deg2_deg2_1polynome(self): # Arrange firstPol = Polynome([-3, -2, -1]) secondPol = Polynome([-8, -2, -3]) # Act eq = firstPol.__rsub__(secondPol) # Assert self.assertEqual(str(eq), '-5x^2 - 2')
def test_radd_deg2_deg2_zero_polynome(self): # Arrange firstPol = Polynome([-112, -771, -892]) secondPol = Polynome([112, 771, 892]) # Act eq = firstPol.__radd__(secondPol) # Assert self.assertEqual(str(eq), '0')
def test_rsub_deg2_deq0_2polynome(self): # Arrange firstPol = Polynome([28, 71, -2]) secondPol = Polynome([0]) # Act eq = firstPol.__rsub__(secondPol) # Assert self.assertEqual(str(eq), '-28x^2 - 71x + 2')
def test_radd_deg2_deq0_2polynome(self): # Arrange firstPol = Polynome([2, 100, -25]) second = Polynome([0]) # Act eq = firstPol.__radd__(second) # Assert self.assertEqual(str(eq), '2x^2 + 100x - 25')
def test_rsub_deg0_deq0_zero_polynome(self): # Arrange firstPol = Polynome([0]) secondPol = Polynome([0]) # Act eq = firstPol.__rsub__(secondPol) # Assert self.assertEqual(str(eq), '0')
def test_radd_deg2_deq2_0polynome(self): # Arrange firstPol = Polynome([22, 14, -20]) secondPol = Polynome([-22, -14, 30]) # Act eq = firstPol.__radd__(secondPol) # Assert self.assertEqual(str(eq), '10')
def test_ne_deg2_deg2_True(self): # Arrange firstPol = Polynome([72, 18, -2]) secondPol = Polynome([72, 52, -2]) # Act eq = firstPol != secondPol # Assert self.assertTrue(eq)
def test_iadd_deg2_deg2_2polynome(self): # Arrange firstPol = Polynome([-3, -2, -1]) secondPol = Polynome([18, 15, -2]) # Act firstPol += secondPol # Assert self.assertEqual(str(firstPol), '15x^2 + 13x - 3')
def test_eq_deg2_deg2_True(self): # Arrange firstPol = Polynome([9, 1, -9]) secondPol = Polynome([9, 1, -9]) # Act eq = firstPol.__eq__(secondPol) # Assert self.assertTrue(eq)
def test_eq_deg2_float_True(self): # Arrange firstPol = Polynome([4.8]) secondPol = float(4.8) # Act eq = firstPol.__eq__(secondPol) # Assert self.assertTrue(eq)