Hit missed lines in equality tests

This commit is contained in:
Tom MacWright
2016-02-18 19:03:23 -05:00
committed by Tobrun
parent 9ec0103431
commit d697028029
4 changed files with 24 additions and 0 deletions

View File

@@ -120,6 +120,7 @@ public class LatLngBoundsTest {
.include(LAT_LNG_NOT_NULL_ISLAND)
.build();
assertEquals("equality should match", mLatLngBounds, latLngBounds);
assertEquals("not equal to a different object type", mLatLngBounds.equals(LAT_LNG_NOT_NULL_ISLAND), false);
}
@Test

View File

@@ -10,6 +10,7 @@ import static org.junit.Assert.assertNotNull;
public class LatLngSpanTest {
private static final double DELTA = 1e-15;
private static final LatLng LAT_LNG_NULL_ISLAND = new LatLng(0, 0);
@Test
public void testSanity() {
@@ -17,6 +18,12 @@ public class LatLngSpanTest {
assertNotNull("latLngSpan should not be null", latLngSpan);
}
@Test
public void testEquality() {
LatLngSpan latLngSpan = new LatLngSpan(0.0, 0.0);
assertEquals("latLngSpan is not equal to a LatLng", latLngSpan.equals(LAT_LNG_NULL_ISLAND), false);
}
@Test
public void testLatitudeConstructor() {
double latitude = 1.23;

View File

@@ -7,12 +7,21 @@ import static org.junit.Assert.assertNotNull;
public class ProjectedMetersTest {
private static final LatLng LAT_LNG_NULL_ISLAND = new LatLng(0, 0);
@Test
public void testSanity() {
ProjectedMeters projectedMeters = new ProjectedMeters(0.0, 0.0);
assertNotNull("projectedMeters should not be null", projectedMeters);
}
@Test
public void testEquality() {
ProjectedMeters projectedMeters = new ProjectedMeters(0.0, 0.0);
assertEquals("projectedMeters is not equal to a LatLng", projectedMeters.equals(LAT_LNG_NULL_ISLAND), false);
assertEquals("projectedMeters is equal to itself", projectedMeters.equals(projectedMeters), true);
}
@Test
public void testNorthing() {
ProjectedMeters projectedMeters = new ProjectedMeters(1.0, 0.0);

View File

@@ -19,6 +19,13 @@ public class VisibleRegionTest {
assertNotNull("region should not be null", region);
}
@Test
public void testEquality() {
VisibleRegion region = new VisibleRegion(FAR_LEFT, FAR_RIGHT, NEAR_LEFT, NEAR_RIGHT, BOUNDS);
assertEquals("visibleRegion is not equal to a LatLng", region.equals(FAR_LEFT), false);
assertEquals("visibleRegion is equal to itself", region.equals(region), true);
}
@Test
public void testFarLeftConstructor() {
VisibleRegion region = new VisibleRegion(FAR_LEFT, FAR_RIGHT, NEAR_LEFT, NEAR_RIGHT, BOUNDS);