@Test public void givenTwoFarLocationsButTooShortRange_ShouldBeInRange() { Coordinates manhattan = Coordinates.locatedAt(40.7791547, -73.9654464); Coordinates harvardUniversity = Coordinates.locatedAt(42.3770068, -71.1188488); Length range = Length.fromMiles(50); boolean inRange = manhattan.isInRange(harvardUniversity, range); assertThat(inRange).isFalse(); }
@Test public void givenTwoFarLocationsButVeryLargeRange_ShouldBeInRange() { Coordinates manhattan = Coordinates.locatedAt(40.7791547, -73.9654464); Coordinates harvardUniversity = Coordinates.locatedAt(42.3770068, -71.1188488); Length range = Length.fromMiles(200); boolean inRange = harvardUniversity.isInRange(manhattan, range); assertThat(inRange).isTrue(); }
@Test public void givenTwoVeryNearLocationsAndVeryShortRange_ShouldBeInRange() { Coordinates googlePlex = Coordinates.locatedAt(37.4218047, -122.0838097); Coordinates googleSoccerField = Coordinates.locatedAt(37.424242, -122.0874509); Length range = Length.fromMiles(0.30); boolean inRange = googlePlex.isInRange(googleSoccerField, range); assertThat(inRange).isTrue(); }