def test_Multiply_Input_Neg3_4_Returns_12(self):
     # Arrange
     leftNum = SingleNumberExpression(-3)
     rightNum = SingleNumberExpression(4)
     binaryExpression = MultiplicationExpression(leftNum, rightNum)
     # Act
     actual = binaryExpression.evaluate()
     expected = -12
     # Assert
     self.assertEqual(actual, expected)
 def test_Multiply_Sum_2_1_And_Sum_1_3_Returns_12(self):
     # Arrange
     leftExpression = AdditionExpression(SingleNumberExpression(2),
                                         SingleNumberExpression(1))
     rightExpression = AdditionExpression(SingleNumberExpression(1),
                                          SingleNumberExpression(3))
     entireExpression = MultiplicationExpression(leftExpression,
                                                 rightExpression)
     # Act
     actual = entireExpression.evaluate()
     expected = 12
     # Assert
     self.assertEqual(actual, expected)
 def CreateExpression(self, leftExp, operatorSign, rightExp):
     if (operatorSign == "+"):
         return AdditionExpression(leftExp, rightExp)
     if (operatorSign == "-"):
         return SubtractionExpression(leftExp, rightExp)
     if (operatorSign == "/"):
         return DivisionExpression(leftExp, rightExp)
     return MultiplicationExpression(leftExp, rightExp)
 def test_Divide_Difference_11_1_And_Product_2_5_Returns_1(self):
     # Arrange
     leftExpression = SubtractionExpression(SingleNumberExpression(11),
                                            SingleNumberExpression(1))
     rightExpression = MultiplicationExpression(SingleNumberExpression(2),
                                                SingleNumberExpression(5))
     entireExpression = DivisionExpression(leftExpression, rightExpression)
     # Act
     actual = entireExpression.evaluate()
     expected = 1
     # Assert
     self.assertEqual(actual, expected)