Unit test fails yet biComplexNumber1.equals(biComplexNumber2)
holds true.
Unit test:
public void simpleTest(){
BicomplexNumber b1 = new BicomplexNumber(1,2,3,4);
BicomplexNumber b2 = new BicomplexNumber(1,2,3,4);
assertEquals("Simple Test", b1, b2);
}
Equality check
public boolean equals(BicomplexNumber bicomplexObj)
{
if(bicomplexObj == this) return true;
if(bicomplexObj.getA() != this.getA()) return false;
if(bicomplexObj.getB() != this.getB()) return false;
if(bicomplexObj.getC() != this.getC()) return false;
if(bicomplexObj.getD() != this.getD()) return false;
return true;
}
The equality check seems to be correct when I would like it too. But I have included it anyway.