I did an assertEqual test and it fails even though it showing that the expected and actual results are the same.I looked it up and I saw that you need to check that the compared objects are of the same type,in this case,they are but it still fails,this it the test:
public void testConstructRayThroughPixel() {
System.out.println("constructRayThroughPixel");
int Nx = 3;
int Ny = 3;
double x = 3.0;
double y = 3.0;
double screenDistance = 100.0;
double screenWidth = 150.0;
double screenHeight = 150.0;
Camera instance = new Camera();
Ray expResult = new Ray(new Point3D(new Coordinate(50),new Coordinate(-50),new Coordinate(-100)),new Vector(new Point3D(new Coordinate(50),new Coordinate(-50),new Coordinate(-100))));
Ray result = instance.constructRayThroughPixel(Nx, Ny, x, y, screenDistance, screenWidth, screenHeight);
assertEquals(expResult, result);
}
this is the result (Uploaded an image):
To the guys editing here,I don't know how it has anything to do with double type,this is a comprehension between two objects of "Ray"..