Write test class with at least two unit tests that test different cases for the closer() function
Fantastic news! We've Found the answer you've been seeking!
Question:
Write test class with at least two unit tests that test different cases for the closer() function described below:
Either write a 3rd distinct test case for closer() or explain why 2 cases is enough
class Loc { // (latitude, longitude) - coordinates for location on a map public Loc(float lat, float lon);
}
class Nav {
// Destination
public void setDest(Loc goal);
// return negative value if loc1 is closer to destination than loc2
// positive value if loc2 is closer
// zero if they are equally close to the destination
public int closer(Loc loc1, Loc loc2);
}
class TestNav { // Your test code goes here
Related Book For
Calculus And Its Applications
ISBN: 9780134437774
14th Edition
Authors: Larry Goldstein, David Lay, David Schneider, Nakhle Asmar
Posted Date: