Exemple #1
0
 def testGivenExpressionWithTwoVariablesWithSameNameWhenApplyAndSimplifyThenGetValueReturnsCorrectValue(
         self):
     expression = ExpressionBuilder().term(VariableBuilder().name('x').value(3.0).build()). \
         term(VariableBuilder().name('x').value(2.0).build()).build()
     expression.apply('x', 1.0)
     expression.simplify_constant()
     self.assertEqual(expression.get_value_constant(), 5.0)
Exemple #2
0
 def testGivenExpressionWithVariableWhenApplyThenGetValueReturnsCorrectValue(
         self):
     expression = ExpressionBuilder().term(
         VariableBuilder().name('x').value(3.0).build()).build()
     expression.apply('x', 1.0)
     self.assertEqual(expression.get_value_constant(), 3.0)