Пример #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')
Пример #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')
Пример #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')
Пример #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')
Пример #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')
Пример #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')