Imani G.

asked • 10/05/23

create JUnit 5 test for these code

@Test

public void getEndpoints() {

}

@Test

public void distance() {

}

@Test

public void slope() {

}

@Test

public void midpoint() {

with this code:

public Point2D[] getEndpoints() {
Point2D[] endpoints = new Point2D[2];
endpoints[0] = endPoint1.copyOf();
endpoints[1] = endPoint2.copyOf();
return endpoints;
}

public double distance() {
return endPoint1.distance(endPoint2);
}

public double slope() {
return endPoint1.slope(endPoint2);
}

public Point2D midpoint() {
return endPoint1.midpoint(endPoint2);
}

1 Expert Answer

By:

Henry T. answered • 11/30/23

Tutor
New to Wyzant

Experienced Java Tutor: CS Graduate with 5+ Years Professional Ex

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.