Skip to content

Instantly share code, notes, and snippets.

@FagnerMartinsBrack
Last active November 4, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FagnerMartinsBrack/0ea854114ca793eca60b to your computer and use it in GitHub Desktop.
Save FagnerMartinsBrack/0ea854114ca793eca60b to your computer and use it in GitHub Desktop.
EarthLocationTest
public class EarthLocationTest {
@Test
public void test_southwest_hemisphere_distances() {
EarthLocation portoAlegre = new EarthLocation( -30.0277, -51.2287 );
EarthLocation manaus = new EarthLocation( -3.1064, -60.0264 );
int expected = 3133;
int distance = portoAlegre.getDistanceOf( manaus );
Assert.assertEquals( expected, distance );
}
@Test
public void test_northeast_hemisphere_distances() {
EarthLocation seoul = new EarthLocation( 37.5665, 126.9779 );
EarthLocation rome = new EarthLocation( 41.8905, 12.4942 );
int expected = 8967;
int distance = seoul.getDistanceOf( rome );
Assert.assertEquals( expected, distance );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment