mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-05 11:03:06 +02:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user