Fix unit tests with TrackPathDescriptor.

In MapOverlay, for testing, expose a getter and a setter
for TrackPathDescriptor instead of newPath and getLastPath.

In SingleColorTrackPathPainter, refactor "new Path" to a
newPath method so that tests can override the newPath method
to provide a mockPath.
This commit is contained in:
Jimmy Shih
2011-10-10 16:47:59 -07:00
parent c39ab2fda2
commit 21e47d8ce0
8 changed files with 57 additions and 28 deletions
@@ -19,7 +19,6 @@ import com.google.android.maps.MapView;
import com.google.android.maps.Projection;
import android.content.Context;
import android.graphics.Path;
import android.graphics.Rect;
/**
@@ -32,7 +31,7 @@ import android.graphics.Rect;
* {@class MapView}.
*/
public class MockMyTracksOverlay extends MapOverlay {
private Projection mockProjection;
public MockMyTracksOverlay(Context context) {
@@ -49,9 +48,4 @@ public class MockMyTracksOverlay extends MapOverlay {
public Rect getMapViewRect(MapView mapView) {
return new Rect(0, 0, 100, 100);
}
@Override
public Path newPath() {
return new MockPath();
}
}