Ejemplo n.º 1
0
 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')
Ejemplo n.º 2
0
 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')
Ejemplo n.º 3
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')
Ejemplo n.º 4
0
 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')
Ejemplo n.º 5
0
 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')
Ejemplo n.º 6
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')