def testGivenXIs1EquationAndXIs0WhenAskedForEqualityThenFalseIsReturned( self): equation1 = EquationBuilder.x_equals_0() equation2 = EquationBuilder.x_equals_1() self.assertFalse(equation1.equal(equation2)) self.assertFalse(equation1 == equation2) self.assertTrue(equation1 != equation2)
def testGivenXIs0EquationWhenAddOIsYEquationThenYIsXEquationIsObtained( self): equation = EquationBuilder.x_equals_0() equation.add_equation(EquationBuilder.zero_equals_y()) expected_equation = EquationBuilder().left_term( VariableBuilder().name('x').value(1.0).build()).left_term( ConstantBuilder().value(0).build()).right_term( ConstantBuilder().value(0).build()).right_term( VariableBuilder().name('y').value( 1.0).build()).build() self.assertTrue(equation.equal(expected_equation))