def testGivenEquationWithOneVariableAtLeftWhenGetValueThenVariableValueIsReturned(
         self):
     variable = VariableBuilder().build()
     equation = EquationBuilder().left_term(
         variable).right_default_constant().build()
     self.assertEqual(equation.get_value_variable(Side.left, variable.name),
                      variable.value)
 def testGivenEquationSameVariableTwiceAtRightWithNameXWhenSimplifyNameXThenVariableIsSimplified(
         self):
     term = VariableBuilder().build()
     equation = EquationBuilder().right_term(term).right_term(
         term).left_default_constant().build()
     equation.simplify_variable(Side.right, term.name)
     self.assertEqual(equation.get_value_variable(Side.right, term.name),
                      2 * term.value)
 def testGivenEmptyEquationWhenGetValueThen0IsReturned(self):
     equation = EquationBuilder().build()
     self.assertEqual(equation.get_value_variable(Side.left, 'x'), 0.0)
     self.assertEqual(equation.get_value_variable(Side.right, 'x'), 0.0)