Ejemplo n.º 1
0
 def testGivenExpressionWithConstantAndVariableWhenMultiplyThenGetValuesReturnsMultipliedTermsValues(
         self):
     constant = ConstantBuilder().build()
     variable = VariableBuilder().build()
     expression = ExpressionBuilder().term(constant).term(variable).build()
     multiply_value = 2.0
     expression.multiply(multiply_value)
     constant.multiply(multiply_value)
     variable.multiply(multiply_value)
     self.assertEqual(expression.get_value_constant(), constant.value)
     self.assertEqual(expression.get_value_variable(variable.name),
                      variable.value)
 def testMultiply(self):
     variable = VariableBuilder().value(3.0).build()
     variable.multiply(2.0)
     self.assertEqual(variable.value, 6.0)